github.com/llir/llvm@v0.3.6/asm/enum/callingconv_string2enum.go (about) 1 // Code generated by "string2enum -linecomment -type CallingConv ../../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.CallingConvNone-0] 16 _ = x[enum.CallingConvC-1] 17 _ = x[enum.CallingConvFast-8] 18 _ = x[enum.CallingConvCold-9] 19 _ = x[enum.CallingConvGHC-10] 20 _ = x[enum.CallingConvHiPE-11] 21 _ = x[enum.CallingConvWebKitJS-12] 22 _ = x[enum.CallingConvAnyReg-13] 23 _ = x[enum.CallingConvPreserveMost-14] 24 _ = x[enum.CallingConvPreserveAll-15] 25 _ = x[enum.CallingConvSwift-16] 26 _ = x[enum.CallingConvCXXFastTLS-17] 27 _ = x[enum.CallingConvTail-18] 28 _ = x[enum.CallingConvCFGuardCheck-19] 29 _ = x[enum.CallingConvSwiftTail-20] 30 _ = x[enum.CallingConvX86StdCall-64] 31 _ = x[enum.CallingConvX86FastCall-65] 32 _ = x[enum.CallingConvARM_APCS-66] 33 _ = x[enum.CallingConvARM_AAPCS-67] 34 _ = x[enum.CallingConvARM_AAPCS_VFP-68] 35 _ = x[enum.CallingConvMSP430Interrupt-69] 36 _ = x[enum.CallingConvX86ThisCall-70] 37 _ = x[enum.CallingConvPTXKernel-71] 38 _ = x[enum.CallingConvPTXDevice-72] 39 _ = x[enum.CallingConvSPIRFunc-75] 40 _ = x[enum.CallingConvSPIRKernel-76] 41 _ = x[enum.CallingConvIntelOCL_BI-77] 42 _ = x[enum.CallingConvX86_64SysV-78] 43 _ = x[enum.CallingConvWin64-79] 44 _ = x[enum.CallingConvX86VectorCall-80] 45 _ = x[enum.CallingConvHHVM-81] 46 _ = x[enum.CallingConvHHVM_C-82] 47 _ = x[enum.CallingConvX86Interrupt-83] 48 _ = x[enum.CallingConvAVRInterrupt-84] 49 _ = x[enum.CallingConvAVRSignal-85] 50 _ = x[enum.CallingConvAVRBuiltin-86] 51 _ = x[enum.CallingConvAMDGPU_VS-87] 52 _ = x[enum.CallingConvAMDGPU_GS-88] 53 _ = x[enum.CallingConvAMDGPU_PS-89] 54 _ = x[enum.CallingConvAMDGPU_CS-90] 55 _ = x[enum.CallingConvAMDGPUKernel-91] 56 _ = x[enum.CallingConvX86RegCall-92] 57 _ = x[enum.CallingConvAMDGPU_HS-93] 58 _ = x[enum.CallingConvMSP430Builtin-94] 59 _ = x[enum.CallingConvAMDGPU_LS-95] 60 _ = x[enum.CallingConvAMDGPU_ES-96] 61 _ = x[enum.CallingConvAArch64VectorCall-97] 62 _ = x[enum.CallingConvAArch64SVEVectorCall-98] 63 _ = x[enum.CallingConvAMDGPUGfx-100] 64 } 65 66 const ( 67 _CallingConv_name_0 = "noneccc" 68 _CallingConv_name_1 = "fastcccoldccghccccc 11webkit_jsccanyregccpreserve_mostccpreserve_allccswiftcccxx_fast_tlscctailcccfguard_checkccswifttailcc" 69 _CallingConv_name_2 = "x86_stdcallccx86_fastcallccarm_apcsccarm_aapcsccarm_aapcs_vfpccmsp430_intrccx86_thiscallccptx_kernelptx_device" 70 _CallingConv_name_3 = "spir_funcspir_kernelintel_ocl_biccx86_64_sysvccwin64ccx86_vectorcallcchhvmcchhvm_cccx86_intrccavr_intrccavr_signalcccc 86amdgpu_vsamdgpu_gsamdgpu_psamdgpu_csamdgpu_kernelx86_regcallccamdgpu_hscc 94amdgpu_lsamdgpu_esaarch64_vector_pcsaarch64_sve_vector_pcs" 71 _CallingConv_name_4 = "amdgpu_gfx" 72 ) 73 74 var ( 75 _CallingConv_index_0 = [...]uint8{0, 4, 7} 76 _CallingConv_index_1 = [...]uint8{0, 6, 12, 17, 22, 33, 41, 56, 70, 77, 91, 97, 112, 123} 77 _CallingConv_index_2 = [...]uint8{0, 13, 27, 37, 48, 63, 76, 90, 100, 110} 78 _CallingConv_index_3 = [...]uint8{0, 9, 20, 34, 47, 54, 70, 76, 84, 94, 104, 116, 121, 130, 139, 148, 157, 170, 183, 192, 197, 206, 215, 233, 255} 79 ) 80 81 // CallingConvFromString returns the CallingConv enum corresponding to s. 82 func CallingConvFromString(s string) enum.CallingConv { 83 if len(s) == 0 { 84 return 0 85 } 86 for i := range _CallingConv_index_0[:len(_CallingConv_index_0)-1] { 87 if s == _CallingConv_name_0[_CallingConv_index_0[i]:_CallingConv_index_0[i+1]] { 88 return enum.CallingConv(i + 0) 89 } 90 } 91 for i := range _CallingConv_index_1[:len(_CallingConv_index_1)-1] { 92 if s == _CallingConv_name_1[_CallingConv_index_1[i]:_CallingConv_index_1[i+1]] { 93 return enum.CallingConv(i + 8) 94 } 95 } 96 for i := range _CallingConv_index_2[:len(_CallingConv_index_2)-1] { 97 if s == _CallingConv_name_2[_CallingConv_index_2[i]:_CallingConv_index_2[i+1]] { 98 return enum.CallingConv(i + 64) 99 } 100 } 101 for i := range _CallingConv_index_3[:len(_CallingConv_index_3)-1] { 102 if s == _CallingConv_name_3[_CallingConv_index_3[i]:_CallingConv_index_3[i+1]] { 103 return enum.CallingConv(i + 75) 104 } 105 } 106 if s == _CallingConv_name_4 { 107 return enum.CallingConv(100) 108 } 109 panic(fmt.Errorf("unable to locate CallingConv enum corresponding to %q", s)) 110 } 111 112 func _(s string) { 113 // Check for duplicate string values in type "CallingConv". 114 switch s { 115 // 0 116 case "none": 117 // 1 118 case "ccc": 119 // 8 120 case "fastcc": 121 // 9 122 case "coldcc": 123 // 10 124 case "ghccc": 125 // 11 126 case "cc 11": 127 // 12 128 case "webkit_jscc": 129 // 13 130 case "anyregcc": 131 // 14 132 case "preserve_mostcc": 133 // 15 134 case "preserve_allcc": 135 // 16 136 case "swiftcc": 137 // 17 138 case "cxx_fast_tlscc": 139 // 18 140 case "tailcc": 141 // 19 142 case "cfguard_checkcc": 143 // 20 144 case "swifttailcc": 145 // 64 146 case "x86_stdcallcc": 147 // 65 148 case "x86_fastcallcc": 149 // 66 150 case "arm_apcscc": 151 // 67 152 case "arm_aapcscc": 153 // 68 154 case "arm_aapcs_vfpcc": 155 // 69 156 case "msp430_intrcc": 157 // 70 158 case "x86_thiscallcc": 159 // 71 160 case "ptx_kernel": 161 // 72 162 case "ptx_device": 163 // 75 164 case "spir_func": 165 // 76 166 case "spir_kernel": 167 // 77 168 case "intel_ocl_bicc": 169 // 78 170 case "x86_64_sysvcc": 171 // 79 172 case "win64cc": 173 // 80 174 case "x86_vectorcallcc": 175 // 81 176 case "hhvmcc": 177 // 82 178 case "hhvm_ccc": 179 // 83 180 case "x86_intrcc": 181 // 84 182 case "avr_intrcc": 183 // 85 184 case "avr_signalcc": 185 // 86 186 case "cc 86": 187 // 87 188 case "amdgpu_vs": 189 // 88 190 case "amdgpu_gs": 191 // 89 192 case "amdgpu_ps": 193 // 90 194 case "amdgpu_cs": 195 // 91 196 case "amdgpu_kernel": 197 // 92 198 case "x86_regcallcc": 199 // 93 200 case "amdgpu_hs": 201 // 94 202 case "cc 94": 203 // 95 204 case "amdgpu_ls": 205 // 96 206 case "amdgpu_es": 207 // 97 208 case "aarch64_vector_pcs": 209 // 98 210 case "aarch64_sve_vector_pcs": 211 // 100 212 case "amdgpu_gfx": 213 } 214 }