github.com/llir/llvm@v0.3.6/asm/enum/ipred_string2enum.go (about)

     1  // Code generated by "string2enum -linecomment -type IPred ../../ir/enum"; DO NOT EDIT.
     2  
     3  package enum
     4  
     5  import (
     6  	"fmt"
     7  
     8  	"github.com/llir/llvm/ir/enum"
     9  )
    10  
    11  func _() {
    12  	// An "invalid array index" compiler error signifies that the constant values have changed.
    13  	// Re-run the string2enum command to generate them again.
    14  	var x [1]struct{}
    15  	_ = x[enum.IPredEQ-0]
    16  	_ = x[enum.IPredNE-1]
    17  	_ = x[enum.IPredSGE-2]
    18  	_ = x[enum.IPredSGT-3]
    19  	_ = x[enum.IPredSLE-4]
    20  	_ = x[enum.IPredSLT-5]
    21  	_ = x[enum.IPredUGE-6]
    22  	_ = x[enum.IPredUGT-7]
    23  	_ = x[enum.IPredULE-8]
    24  	_ = x[enum.IPredULT-9]
    25  }
    26  
    27  const _IPred_name = "eqnesgesgtslesltugeugtuleult"
    28  
    29  var _IPred_index = [...]uint8{0, 2, 4, 7, 10, 13, 16, 19, 22, 25, 28}
    30  
    31  // IPredFromString returns the IPred enum corresponding to s.
    32  func IPredFromString(s string) enum.IPred {
    33  	if len(s) == 0 {
    34  		return 0
    35  	}
    36  	for i := range _IPred_index[:len(_IPred_index)-1] {
    37  		if s == _IPred_name[_IPred_index[i]:_IPred_index[i+1]] {
    38  			return enum.IPred(i)
    39  		}
    40  	}
    41  	panic(fmt.Errorf("unable to locate IPred enum corresponding to %q", s))
    42  }
    43  
    44  func _(s string) {
    45  	// Check for duplicate string values in type "IPred".
    46  	switch s {
    47  	// 0
    48  	case "eq":
    49  	// 1
    50  	case "ne":
    51  	// 2
    52  	case "sge":
    53  	// 3
    54  	case "sgt":
    55  	// 4
    56  	case "sle":
    57  	// 5
    58  	case "slt":
    59  	// 6
    60  	case "uge":
    61  	// 7
    62  	case "ugt":
    63  	// 8
    64  	case "ule":
    65  	// 9
    66  	case "ult":
    67  	}
    68  }