github.com/llir/llvm@v0.3.6/asm/enum/tail_string2enum.go (about) 1 // Code generated by "string2enum -linecomment -type Tail ../../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.TailNone-0] 16 _ = x[enum.TailMustTail-1] 17 _ = x[enum.TailNoTail-2] 18 _ = x[enum.TailTail-3] 19 } 20 21 const _Tail_name = "nonemusttailnotailtail" 22 23 var _Tail_index = [...]uint8{0, 4, 12, 18, 22} 24 25 // TailFromString returns the Tail enum corresponding to s. 26 func TailFromString(s string) enum.Tail { 27 if len(s) == 0 { 28 return 0 29 } 30 for i := range _Tail_index[:len(_Tail_index)-1] { 31 if s == _Tail_name[_Tail_index[i]:_Tail_index[i+1]] { 32 return enum.Tail(i) 33 } 34 } 35 panic(fmt.Errorf("unable to locate Tail enum corresponding to %q", s)) 36 } 37 38 func _(s string) { 39 // Check for duplicate string values in type "Tail". 40 switch s { 41 // 0 42 case "none": 43 // 1 44 case "musttail": 45 // 2 46 case "notail": 47 // 3 48 case "tail": 49 } 50 }