github.com/llir/llvm@v0.3.6/asm/enum/selectionkind_string2enum.go (about) 1 // Code generated by "string2enum -linecomment -type SelectionKind ../../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.SelectionKindAny-0] 16 _ = x[enum.SelectionKindExactMatch-1] 17 _ = x[enum.SelectionKindLargest-2] 18 _ = x[enum.SelectionKindNoDeduplicate-3] 19 _ = x[enum.SelectionKindSameSize-4] 20 } 21 22 const _SelectionKind_name = "anyexactmatchlargestnodeduplicatesamesize" 23 24 var _SelectionKind_index = [...]uint8{0, 3, 13, 20, 33, 41} 25 26 // SelectionKindFromString returns the SelectionKind enum corresponding to s. 27 func SelectionKindFromString(s string) enum.SelectionKind { 28 if len(s) == 0 { 29 return 0 30 } 31 for i := range _SelectionKind_index[:len(_SelectionKind_index)-1] { 32 if s == _SelectionKind_name[_SelectionKind_index[i]:_SelectionKind_index[i+1]] { 33 return enum.SelectionKind(i) 34 } 35 } 36 panic(fmt.Errorf("unable to locate SelectionKind enum corresponding to %q", s)) 37 } 38 39 func _(s string) { 40 // Check for duplicate string values in type "SelectionKind". 41 switch s { 42 // 0 43 case "any": 44 // 1 45 case "exactmatch": 46 // 2 47 case "largest": 48 // 3 49 case "nodeduplicate": 50 // 4 51 case "samesize": 52 } 53 }