github.com/llir/llvm@v0.3.6/asm/enum/unnamedaddr_string2enum.go (about) 1 // Code generated by "string2enum -linecomment -type UnnamedAddr ../../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.UnnamedAddrNone-0] 16 _ = x[enum.UnnamedAddrLocalUnnamedAddr-1] 17 _ = x[enum.UnnamedAddrUnnamedAddr-2] 18 } 19 20 const _UnnamedAddr_name = "nonelocal_unnamed_addrunnamed_addr" 21 22 var _UnnamedAddr_index = [...]uint8{0, 4, 22, 34} 23 24 // UnnamedAddrFromString returns the UnnamedAddr enum corresponding to s. 25 func UnnamedAddrFromString(s string) enum.UnnamedAddr { 26 if len(s) == 0 { 27 return 0 28 } 29 for i := range _UnnamedAddr_index[:len(_UnnamedAddr_index)-1] { 30 if s == _UnnamedAddr_name[_UnnamedAddr_index[i]:_UnnamedAddr_index[i+1]] { 31 return enum.UnnamedAddr(i) 32 } 33 } 34 panic(fmt.Errorf("unable to locate UnnamedAddr enum corresponding to %q", s)) 35 } 36 37 func _(s string) { 38 // Check for duplicate string values in type "UnnamedAddr". 39 switch s { 40 // 0 41 case "none": 42 // 1 43 case "local_unnamed_addr": 44 // 2 45 case "unnamed_addr": 46 } 47 }