github.com/llir/llvm@v0.3.6/asm/enum/nametablekind_string2enum.go (about) 1 // Code generated by "string2enum -linecomment -type NameTableKind ../../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.NameTableKindDefault-0] 16 _ = x[enum.NameTableKindGNU-1] 17 _ = x[enum.NameTableKindNone-2] 18 } 19 20 const _NameTableKind_name = "DefaultGNUNone" 21 22 var _NameTableKind_index = [...]uint8{0, 7, 10, 14} 23 24 // NameTableKindFromString returns the NameTableKind enum corresponding to s. 25 func NameTableKindFromString(s string) enum.NameTableKind { 26 if len(s) == 0 { 27 return 0 28 } 29 for i := range _NameTableKind_index[:len(_NameTableKind_index)-1] { 30 if s == _NameTableKind_name[_NameTableKind_index[i]:_NameTableKind_index[i+1]] { 31 return enum.NameTableKind(i) 32 } 33 } 34 panic(fmt.Errorf("unable to locate NameTableKind enum corresponding to %q", s)) 35 } 36 37 func _(s string) { 38 // Check for duplicate string values in type "NameTableKind". 39 switch s { 40 // 0 41 case "Default": 42 // 1 43 case "GNU": 44 // 2 45 case "None": 46 } 47 }