github.com/llir/llvm@v0.3.6/asm/enum/emissionkind_string2enum.go (about) 1 // Code generated by "string2enum -linecomment -type EmissionKind ../../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.EmissionKindNoDebug-0] 16 _ = x[enum.EmissionKindFullDebug-1] 17 _ = x[enum.EmissionKindLineTablesOnly-2] 18 _ = x[enum.EmissionKindDebugDirectivesOnly-3] 19 } 20 21 const _EmissionKind_name = "NoDebugFullDebugLineTablesOnlyDebugDirectivesOnly" 22 23 var _EmissionKind_index = [...]uint8{0, 7, 16, 30, 49} 24 25 // EmissionKindFromString returns the EmissionKind enum corresponding to s. 26 func EmissionKindFromString(s string) enum.EmissionKind { 27 if len(s) == 0 { 28 return 0 29 } 30 for i := range _EmissionKind_index[:len(_EmissionKind_index)-1] { 31 if s == _EmissionKind_name[_EmissionKind_index[i]:_EmissionKind_index[i+1]] { 32 return enum.EmissionKind(i) 33 } 34 } 35 panic(fmt.Errorf("unable to locate EmissionKind enum corresponding to %q", s)) 36 } 37 38 func _(s string) { 39 // Check for duplicate string values in type "EmissionKind". 40 switch s { 41 // 0 42 case "NoDebug": 43 // 1 44 case "FullDebug": 45 // 2 46 case "LineTablesOnly": 47 // 3 48 case "DebugDirectivesOnly": 49 } 50 }