1 //===- EnumTables.cpp - Enum to string conversion tables ------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "llvm/DebugInfo/CodeView/EnumTables.h" 10 #include "llvm/Support/ScopedPrinter.h" 11 #include <type_traits> 12 13 using namespace llvm; 14 using namespace codeview; 15 16 #define CV_ENUM_CLASS_ENT(enum_class, enum) \ 17 { #enum, std::underlying_type < enum_class > ::type(enum_class::enum) } 18 19 #define CV_ENUM_ENT(ns, enum) \ 20 { #enum, ns::enum } 21 22 static const EnumEntry<SymbolKind> SymbolTypeNames[] = { 23 #define CV_SYMBOL(enum, val) {#enum, enum}, 24 #include "llvm/DebugInfo/CodeView/CodeViewSymbols.def" 25 #undef CV_SYMBOL 26 }; 27 28 static const EnumEntry<TypeLeafKind> TypeLeafNames[] = { 29 #define CV_TYPE(name, val) {#name, name}, 30 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def" 31 #undef CV_TYPE 32 }; 33 34 static const EnumEntry<uint16_t> RegisterNames_X86[] = { 35 #define CV_REGISTERS_X86 36 #define CV_REGISTER(name, val) CV_ENUM_CLASS_ENT(RegisterId, name), 37 #include "llvm/DebugInfo/CodeView/CodeViewRegisters.def" 38 #undef CV_REGISTER 39 #undef CV_REGISTERS_X86 40 }; 41 42 static const EnumEntry<uint16_t> RegisterNames_ARM[] = { 43 #define CV_REGISTERS_ARM 44 #define CV_REGISTER(name, val) CV_ENUM_CLASS_ENT(RegisterId, name), 45 #include "llvm/DebugInfo/CodeView/CodeViewRegisters.def" 46 #undef CV_REGISTER 47 #undef CV_REGISTERS_ARM 48 }; 49 50 static const EnumEntry<uint16_t> RegisterNames_ARM64[] = { 51 #define CV_REGISTERS_ARM64 52 #define CV_REGISTER(name, val) CV_ENUM_CLASS_ENT(RegisterId, name), 53 #include "llvm/DebugInfo/CodeView/CodeViewRegisters.def" 54 #undef CV_REGISTER 55 #undef CV_REGISTERS_ARM64 56 }; 57 58 static const EnumEntry<uint32_t> PublicSymFlagNames[] = { 59 CV_ENUM_CLASS_ENT(PublicSymFlags, Code), 60 CV_ENUM_CLASS_ENT(PublicSymFlags, Function), 61 CV_ENUM_CLASS_ENT(PublicSymFlags, Managed), 62 CV_ENUM_CLASS_ENT(PublicSymFlags, MSIL), 63 }; 64 65 static const EnumEntry<uint8_t> ProcSymFlagNames[] = { 66 CV_ENUM_CLASS_ENT(ProcSymFlags, HasFP), 67 CV_ENUM_CLASS_ENT(ProcSymFlags, HasIRET), 68 CV_ENUM_CLASS_ENT(ProcSymFlags, HasFRET), 69 CV_ENUM_CLASS_ENT(ProcSymFlags, IsNoReturn), 70 CV_ENUM_CLASS_ENT(ProcSymFlags, IsUnreachable), 71 CV_ENUM_CLASS_ENT(ProcSymFlags, HasCustomCallingConv), 72 CV_ENUM_CLASS_ENT(ProcSymFlags, IsNoInline), 73 CV_ENUM_CLASS_ENT(ProcSymFlags, HasOptimizedDebugInfo), 74 }; 75 76 static const EnumEntry<uint16_t> LocalFlags[] = { 77 CV_ENUM_CLASS_ENT(LocalSymFlags, IsParameter), 78 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAddressTaken), 79 CV_ENUM_CLASS_ENT(LocalSymFlags, IsCompilerGenerated), 80 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAggregate), 81 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAggregated), 82 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAliased), 83 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAlias), 84 CV_ENUM_CLASS_ENT(LocalSymFlags, IsReturnValue), 85 CV_ENUM_CLASS_ENT(LocalSymFlags, IsOptimizedOut), 86 CV_ENUM_CLASS_ENT(LocalSymFlags, IsEnregisteredGlobal), 87 CV_ENUM_CLASS_ENT(LocalSymFlags, IsEnregisteredStatic), 88 }; 89 90 static const EnumEntry<uint8_t> FrameCookieKinds[] = { 91 CV_ENUM_CLASS_ENT(FrameCookieKind, Copy), 92 CV_ENUM_CLASS_ENT(FrameCookieKind, XorStackPointer), 93 CV_ENUM_CLASS_ENT(FrameCookieKind, XorFramePointer), 94 CV_ENUM_CLASS_ENT(FrameCookieKind, XorR13), 95 }; 96 97 static const EnumEntry<codeview::SourceLanguage> SourceLanguages[] = { 98 CV_ENUM_ENT(SourceLanguage, C), CV_ENUM_ENT(SourceLanguage, Cpp), 99 CV_ENUM_ENT(SourceLanguage, Fortran), CV_ENUM_ENT(SourceLanguage, Masm), 100 CV_ENUM_ENT(SourceLanguage, Pascal), CV_ENUM_ENT(SourceLanguage, Basic), 101 CV_ENUM_ENT(SourceLanguage, Cobol), CV_ENUM_ENT(SourceLanguage, Link), 102 CV_ENUM_ENT(SourceLanguage, Cvtres), CV_ENUM_ENT(SourceLanguage, Cvtpgd), 103 CV_ENUM_ENT(SourceLanguage, CSharp), CV_ENUM_ENT(SourceLanguage, VB), 104 CV_ENUM_ENT(SourceLanguage, ILAsm), CV_ENUM_ENT(SourceLanguage, Java), 105 CV_ENUM_ENT(SourceLanguage, JScript), CV_ENUM_ENT(SourceLanguage, MSIL), 106 CV_ENUM_ENT(SourceLanguage, HLSL), CV_ENUM_ENT(SourceLanguage, D), 107 CV_ENUM_ENT(SourceLanguage, Swift), 108 }; 109 110 static const EnumEntry<uint32_t> CompileSym2FlagNames[] = { 111 CV_ENUM_CLASS_ENT(CompileSym2Flags, EC), 112 CV_ENUM_CLASS_ENT(CompileSym2Flags, NoDbgInfo), 113 CV_ENUM_CLASS_ENT(CompileSym2Flags, LTCG), 114 CV_ENUM_CLASS_ENT(CompileSym2Flags, NoDataAlign), 115 CV_ENUM_CLASS_ENT(CompileSym2Flags, ManagedPresent), 116 CV_ENUM_CLASS_ENT(CompileSym2Flags, SecurityChecks), 117 CV_ENUM_CLASS_ENT(CompileSym2Flags, HotPatch), 118 CV_ENUM_CLASS_ENT(CompileSym2Flags, CVTCIL), 119 CV_ENUM_CLASS_ENT(CompileSym2Flags, MSILModule), 120 }; 121 122 static const EnumEntry<uint32_t> CompileSym3FlagNames[] = { 123 CV_ENUM_CLASS_ENT(CompileSym3Flags, EC), 124 CV_ENUM_CLASS_ENT(CompileSym3Flags, NoDbgInfo), 125 CV_ENUM_CLASS_ENT(CompileSym3Flags, LTCG), 126 CV_ENUM_CLASS_ENT(CompileSym3Flags, NoDataAlign), 127 CV_ENUM_CLASS_ENT(CompileSym3Flags, ManagedPresent), 128 CV_ENUM_CLASS_ENT(CompileSym3Flags, SecurityChecks), 129 CV_ENUM_CLASS_ENT(CompileSym3Flags, HotPatch), 130 CV_ENUM_CLASS_ENT(CompileSym3Flags, CVTCIL), 131 CV_ENUM_CLASS_ENT(CompileSym3Flags, MSILModule), 132 CV_ENUM_CLASS_ENT(CompileSym3Flags, Sdl), 133 CV_ENUM_CLASS_ENT(CompileSym3Flags, PGO), 134 CV_ENUM_CLASS_ENT(CompileSym3Flags, Exp), 135 }; 136 137 static const EnumEntry<uint32_t> FileChecksumNames[] = { 138 CV_ENUM_CLASS_ENT(FileChecksumKind, None), 139 CV_ENUM_CLASS_ENT(FileChecksumKind, MD5), 140 CV_ENUM_CLASS_ENT(FileChecksumKind, SHA1), 141 CV_ENUM_CLASS_ENT(FileChecksumKind, SHA256), 142 }; 143 144 static const EnumEntry<unsigned> CPUTypeNames[] = { 145 CV_ENUM_CLASS_ENT(CPUType, Intel8080), 146 CV_ENUM_CLASS_ENT(CPUType, Intel8086), 147 CV_ENUM_CLASS_ENT(CPUType, Intel80286), 148 CV_ENUM_CLASS_ENT(CPUType, Intel80386), 149 CV_ENUM_CLASS_ENT(CPUType, Intel80486), 150 CV_ENUM_CLASS_ENT(CPUType, Pentium), 151 CV_ENUM_CLASS_ENT(CPUType, PentiumPro), 152 CV_ENUM_CLASS_ENT(CPUType, Pentium3), 153 CV_ENUM_CLASS_ENT(CPUType, MIPS), 154 CV_ENUM_CLASS_ENT(CPUType, MIPS16), 155 CV_ENUM_CLASS_ENT(CPUType, MIPS32), 156 CV_ENUM_CLASS_ENT(CPUType, MIPS64), 157 CV_ENUM_CLASS_ENT(CPUType, MIPSI), 158 CV_ENUM_CLASS_ENT(CPUType, MIPSII), 159 CV_ENUM_CLASS_ENT(CPUType, MIPSIII), 160 CV_ENUM_CLASS_ENT(CPUType, MIPSIV), 161 CV_ENUM_CLASS_ENT(CPUType, MIPSV), 162 CV_ENUM_CLASS_ENT(CPUType, M68000), 163 CV_ENUM_CLASS_ENT(CPUType, M68010), 164 CV_ENUM_CLASS_ENT(CPUType, M68020), 165 CV_ENUM_CLASS_ENT(CPUType, M68030), 166 CV_ENUM_CLASS_ENT(CPUType, M68040), 167 CV_ENUM_CLASS_ENT(CPUType, Alpha), 168 CV_ENUM_CLASS_ENT(CPUType, Alpha21164), 169 CV_ENUM_CLASS_ENT(CPUType, Alpha21164A), 170 CV_ENUM_CLASS_ENT(CPUType, Alpha21264), 171 CV_ENUM_CLASS_ENT(CPUType, Alpha21364), 172 CV_ENUM_CLASS_ENT(CPUType, PPC601), 173 CV_ENUM_CLASS_ENT(CPUType, PPC603), 174 CV_ENUM_CLASS_ENT(CPUType, PPC604), 175 CV_ENUM_CLASS_ENT(CPUType, PPC620), 176 CV_ENUM_CLASS_ENT(CPUType, PPCFP), 177 CV_ENUM_CLASS_ENT(CPUType, PPCBE), 178 CV_ENUM_CLASS_ENT(CPUType, SH3), 179 CV_ENUM_CLASS_ENT(CPUType, SH3E), 180 CV_ENUM_CLASS_ENT(CPUType, SH3DSP), 181 CV_ENUM_CLASS_ENT(CPUType, SH4), 182 CV_ENUM_CLASS_ENT(CPUType, SHMedia), 183 CV_ENUM_CLASS_ENT(CPUType, ARM3), 184 CV_ENUM_CLASS_ENT(CPUType, ARM4), 185 CV_ENUM_CLASS_ENT(CPUType, ARM4T), 186 CV_ENUM_CLASS_ENT(CPUType, ARM5), 187 CV_ENUM_CLASS_ENT(CPUType, ARM5T), 188 CV_ENUM_CLASS_ENT(CPUType, ARM6), 189 CV_ENUM_CLASS_ENT(CPUType, ARM_XMAC), 190 CV_ENUM_CLASS_ENT(CPUType, ARM_WMMX), 191 CV_ENUM_CLASS_ENT(CPUType, ARM7), 192 CV_ENUM_CLASS_ENT(CPUType, ARM64), 193 CV_ENUM_CLASS_ENT(CPUType, Omni), 194 CV_ENUM_CLASS_ENT(CPUType, Ia64), 195 CV_ENUM_CLASS_ENT(CPUType, Ia64_2), 196 CV_ENUM_CLASS_ENT(CPUType, CEE), 197 CV_ENUM_CLASS_ENT(CPUType, AM33), 198 CV_ENUM_CLASS_ENT(CPUType, M32R), 199 CV_ENUM_CLASS_ENT(CPUType, TriCore), 200 CV_ENUM_CLASS_ENT(CPUType, X64), 201 CV_ENUM_CLASS_ENT(CPUType, EBC), 202 CV_ENUM_CLASS_ENT(CPUType, Thumb), 203 CV_ENUM_CLASS_ENT(CPUType, ARMNT), 204 CV_ENUM_CLASS_ENT(CPUType, D3D11_Shader), 205 }; 206 207 static const EnumEntry<uint32_t> FrameProcSymFlagNames[] = { 208 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasAlloca), 209 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasSetJmp), 210 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasLongJmp), 211 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasInlineAssembly), 212 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasExceptionHandling), 213 CV_ENUM_CLASS_ENT(FrameProcedureOptions, MarkedInline), 214 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasStructuredExceptionHandling), 215 CV_ENUM_CLASS_ENT(FrameProcedureOptions, Naked), 216 CV_ENUM_CLASS_ENT(FrameProcedureOptions, SecurityChecks), 217 CV_ENUM_CLASS_ENT(FrameProcedureOptions, AsynchronousExceptionHandling), 218 CV_ENUM_CLASS_ENT(FrameProcedureOptions, NoStackOrderingForSecurityChecks), 219 CV_ENUM_CLASS_ENT(FrameProcedureOptions, Inlined), 220 CV_ENUM_CLASS_ENT(FrameProcedureOptions, StrictSecurityChecks), 221 CV_ENUM_CLASS_ENT(FrameProcedureOptions, SafeBuffers), 222 CV_ENUM_CLASS_ENT(FrameProcedureOptions, EncodedLocalBasePointerMask), 223 CV_ENUM_CLASS_ENT(FrameProcedureOptions, EncodedParamBasePointerMask), 224 CV_ENUM_CLASS_ENT(FrameProcedureOptions, ProfileGuidedOptimization), 225 CV_ENUM_CLASS_ENT(FrameProcedureOptions, ValidProfileCounts), 226 CV_ENUM_CLASS_ENT(FrameProcedureOptions, OptimizedForSpeed), 227 CV_ENUM_CLASS_ENT(FrameProcedureOptions, GuardCfg), 228 CV_ENUM_CLASS_ENT(FrameProcedureOptions, GuardCfw), 229 }; 230 231 static const EnumEntry<uint32_t> ModuleSubstreamKindNames[] = { 232 CV_ENUM_CLASS_ENT(DebugSubsectionKind, None), 233 CV_ENUM_CLASS_ENT(DebugSubsectionKind, Symbols), 234 CV_ENUM_CLASS_ENT(DebugSubsectionKind, Lines), 235 CV_ENUM_CLASS_ENT(DebugSubsectionKind, StringTable), 236 CV_ENUM_CLASS_ENT(DebugSubsectionKind, FileChecksums), 237 CV_ENUM_CLASS_ENT(DebugSubsectionKind, FrameData), 238 CV_ENUM_CLASS_ENT(DebugSubsectionKind, InlineeLines), 239 CV_ENUM_CLASS_ENT(DebugSubsectionKind, CrossScopeImports), 240 CV_ENUM_CLASS_ENT(DebugSubsectionKind, CrossScopeExports), 241 CV_ENUM_CLASS_ENT(DebugSubsectionKind, ILLines), 242 CV_ENUM_CLASS_ENT(DebugSubsectionKind, FuncMDTokenMap), 243 CV_ENUM_CLASS_ENT(DebugSubsectionKind, TypeMDTokenMap), 244 CV_ENUM_CLASS_ENT(DebugSubsectionKind, MergedAssemblyInput), 245 CV_ENUM_CLASS_ENT(DebugSubsectionKind, CoffSymbolRVA), 246 }; 247 248 static const EnumEntry<uint16_t> ExportSymFlagNames[] = { 249 CV_ENUM_CLASS_ENT(ExportFlags, IsConstant), 250 CV_ENUM_CLASS_ENT(ExportFlags, IsData), 251 CV_ENUM_CLASS_ENT(ExportFlags, IsPrivate), 252 CV_ENUM_CLASS_ENT(ExportFlags, HasNoName), 253 CV_ENUM_CLASS_ENT(ExportFlags, HasExplicitOrdinal), 254 CV_ENUM_CLASS_ENT(ExportFlags, IsForwarder), 255 }; 256 257 static const EnumEntry<uint8_t> ThunkOrdinalNames[] = { 258 CV_ENUM_CLASS_ENT(ThunkOrdinal, Standard), 259 CV_ENUM_CLASS_ENT(ThunkOrdinal, ThisAdjustor), 260 CV_ENUM_CLASS_ENT(ThunkOrdinal, Vcall), 261 CV_ENUM_CLASS_ENT(ThunkOrdinal, Pcode), 262 CV_ENUM_CLASS_ENT(ThunkOrdinal, UnknownLoad), 263 CV_ENUM_CLASS_ENT(ThunkOrdinal, TrampIncremental), 264 CV_ENUM_CLASS_ENT(ThunkOrdinal, BranchIsland), 265 }; 266 267 static const EnumEntry<uint16_t> TrampolineNames[] = { 268 CV_ENUM_CLASS_ENT(TrampolineType, TrampIncremental), 269 CV_ENUM_CLASS_ENT(TrampolineType, BranchIsland), 270 }; 271 272 static const EnumEntry<COFF::SectionCharacteristics> 273 ImageSectionCharacteristicNames[] = { 274 CV_ENUM_ENT(COFF, IMAGE_SCN_TYPE_NOLOAD), 275 CV_ENUM_ENT(COFF, IMAGE_SCN_TYPE_NO_PAD), 276 CV_ENUM_ENT(COFF, IMAGE_SCN_CNT_CODE), 277 CV_ENUM_ENT(COFF, IMAGE_SCN_CNT_INITIALIZED_DATA), 278 CV_ENUM_ENT(COFF, IMAGE_SCN_CNT_UNINITIALIZED_DATA), 279 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_OTHER), 280 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_INFO), 281 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_REMOVE), 282 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_COMDAT), 283 CV_ENUM_ENT(COFF, IMAGE_SCN_GPREL), 284 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_PURGEABLE), 285 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_16BIT), 286 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_LOCKED), 287 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_PRELOAD), 288 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_1BYTES), 289 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_2BYTES), 290 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_4BYTES), 291 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_8BYTES), 292 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_16BYTES), 293 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_32BYTES), 294 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_64BYTES), 295 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_128BYTES), 296 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_256BYTES), 297 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_512BYTES), 298 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_1024BYTES), 299 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_2048BYTES), 300 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_4096BYTES), 301 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_8192BYTES), 302 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_NRELOC_OVFL), 303 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_DISCARDABLE), 304 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_NOT_CACHED), 305 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_NOT_PAGED), 306 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_SHARED), 307 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_EXECUTE), 308 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_READ), 309 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_WRITE)}; 310 311 static const EnumEntry<uint16_t> ClassOptionNames[] = { 312 CV_ENUM_CLASS_ENT(ClassOptions, Packed), 313 CV_ENUM_CLASS_ENT(ClassOptions, HasConstructorOrDestructor), 314 CV_ENUM_CLASS_ENT(ClassOptions, HasOverloadedOperator), 315 CV_ENUM_CLASS_ENT(ClassOptions, Nested), 316 CV_ENUM_CLASS_ENT(ClassOptions, ContainsNestedClass), 317 CV_ENUM_CLASS_ENT(ClassOptions, HasOverloadedAssignmentOperator), 318 CV_ENUM_CLASS_ENT(ClassOptions, HasConversionOperator), 319 CV_ENUM_CLASS_ENT(ClassOptions, ForwardReference), 320 CV_ENUM_CLASS_ENT(ClassOptions, Scoped), 321 CV_ENUM_CLASS_ENT(ClassOptions, HasUniqueName), 322 CV_ENUM_CLASS_ENT(ClassOptions, Sealed), 323 CV_ENUM_CLASS_ENT(ClassOptions, Intrinsic), 324 }; 325 326 static const EnumEntry<uint8_t> MemberAccessNames[] = { 327 CV_ENUM_CLASS_ENT(MemberAccess, None), 328 CV_ENUM_CLASS_ENT(MemberAccess, Private), 329 CV_ENUM_CLASS_ENT(MemberAccess, Protected), 330 CV_ENUM_CLASS_ENT(MemberAccess, Public), 331 }; 332 333 static const EnumEntry<uint16_t> MethodOptionNames[] = { 334 CV_ENUM_CLASS_ENT(MethodOptions, Pseudo), 335 CV_ENUM_CLASS_ENT(MethodOptions, NoInherit), 336 CV_ENUM_CLASS_ENT(MethodOptions, NoConstruct), 337 CV_ENUM_CLASS_ENT(MethodOptions, CompilerGenerated), 338 CV_ENUM_CLASS_ENT(MethodOptions, Sealed), 339 }; 340 341 static const EnumEntry<uint16_t> MemberKindNames[] = { 342 CV_ENUM_CLASS_ENT(MethodKind, Vanilla), 343 CV_ENUM_CLASS_ENT(MethodKind, Virtual), 344 CV_ENUM_CLASS_ENT(MethodKind, Static), 345 CV_ENUM_CLASS_ENT(MethodKind, Friend), 346 CV_ENUM_CLASS_ENT(MethodKind, IntroducingVirtual), 347 CV_ENUM_CLASS_ENT(MethodKind, PureVirtual), 348 CV_ENUM_CLASS_ENT(MethodKind, PureIntroducingVirtual), 349 }; 350 351 static const EnumEntry<uint8_t> PtrKindNames[] = { 352 CV_ENUM_CLASS_ENT(PointerKind, Near16), 353 CV_ENUM_CLASS_ENT(PointerKind, Far16), 354 CV_ENUM_CLASS_ENT(PointerKind, Huge16), 355 CV_ENUM_CLASS_ENT(PointerKind, BasedOnSegment), 356 CV_ENUM_CLASS_ENT(PointerKind, BasedOnValue), 357 CV_ENUM_CLASS_ENT(PointerKind, BasedOnSegmentValue), 358 CV_ENUM_CLASS_ENT(PointerKind, BasedOnAddress), 359 CV_ENUM_CLASS_ENT(PointerKind, BasedOnSegmentAddress), 360 CV_ENUM_CLASS_ENT(PointerKind, BasedOnType), 361 CV_ENUM_CLASS_ENT(PointerKind, BasedOnSelf), 362 CV_ENUM_CLASS_ENT(PointerKind, Near32), 363 CV_ENUM_CLASS_ENT(PointerKind, Far32), 364 CV_ENUM_CLASS_ENT(PointerKind, Near64), 365 }; 366 367 static const EnumEntry<uint8_t> PtrModeNames[] = { 368 CV_ENUM_CLASS_ENT(PointerMode, Pointer), 369 CV_ENUM_CLASS_ENT(PointerMode, LValueReference), 370 CV_ENUM_CLASS_ENT(PointerMode, PointerToDataMember), 371 CV_ENUM_CLASS_ENT(PointerMode, PointerToMemberFunction), 372 CV_ENUM_CLASS_ENT(PointerMode, RValueReference), 373 }; 374 375 static const EnumEntry<uint16_t> PtrMemberRepNames[] = { 376 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, Unknown), 377 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, SingleInheritanceData), 378 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, MultipleInheritanceData), 379 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, VirtualInheritanceData), 380 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, GeneralData), 381 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, SingleInheritanceFunction), 382 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, 383 MultipleInheritanceFunction), 384 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, 385 VirtualInheritanceFunction), 386 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, GeneralFunction), 387 }; 388 389 static const EnumEntry<uint16_t> TypeModifierNames[] = { 390 CV_ENUM_CLASS_ENT(ModifierOptions, Const), 391 CV_ENUM_CLASS_ENT(ModifierOptions, Volatile), 392 CV_ENUM_CLASS_ENT(ModifierOptions, Unaligned), 393 }; 394 395 static const EnumEntry<uint8_t> CallingConventions[] = { 396 CV_ENUM_CLASS_ENT(CallingConvention, NearC), 397 CV_ENUM_CLASS_ENT(CallingConvention, FarC), 398 CV_ENUM_CLASS_ENT(CallingConvention, NearPascal), 399 CV_ENUM_CLASS_ENT(CallingConvention, FarPascal), 400 CV_ENUM_CLASS_ENT(CallingConvention, NearFast), 401 CV_ENUM_CLASS_ENT(CallingConvention, FarFast), 402 CV_ENUM_CLASS_ENT(CallingConvention, NearStdCall), 403 CV_ENUM_CLASS_ENT(CallingConvention, FarStdCall), 404 CV_ENUM_CLASS_ENT(CallingConvention, NearSysCall), 405 CV_ENUM_CLASS_ENT(CallingConvention, FarSysCall), 406 CV_ENUM_CLASS_ENT(CallingConvention, ThisCall), 407 CV_ENUM_CLASS_ENT(CallingConvention, MipsCall), 408 CV_ENUM_CLASS_ENT(CallingConvention, Generic), 409 CV_ENUM_CLASS_ENT(CallingConvention, AlphaCall), 410 CV_ENUM_CLASS_ENT(CallingConvention, PpcCall), 411 CV_ENUM_CLASS_ENT(CallingConvention, SHCall), 412 CV_ENUM_CLASS_ENT(CallingConvention, ArmCall), 413 CV_ENUM_CLASS_ENT(CallingConvention, AM33Call), 414 CV_ENUM_CLASS_ENT(CallingConvention, TriCall), 415 CV_ENUM_CLASS_ENT(CallingConvention, SH5Call), 416 CV_ENUM_CLASS_ENT(CallingConvention, M32RCall), 417 CV_ENUM_CLASS_ENT(CallingConvention, ClrCall), 418 CV_ENUM_CLASS_ENT(CallingConvention, Inline), 419 CV_ENUM_CLASS_ENT(CallingConvention, NearVector), 420 }; 421 422 static const EnumEntry<uint8_t> FunctionOptionEnum[] = { 423 CV_ENUM_CLASS_ENT(FunctionOptions, CxxReturnUdt), 424 CV_ENUM_CLASS_ENT(FunctionOptions, Constructor), 425 CV_ENUM_CLASS_ENT(FunctionOptions, ConstructorWithVirtualBases), 426 }; 427 428 static const EnumEntry<uint16_t> LabelTypeEnum[] = { 429 CV_ENUM_CLASS_ENT(LabelType, Near), 430 CV_ENUM_CLASS_ENT(LabelType, Far), 431 }; 432 433 namespace llvm { 434 namespace codeview { 435 436 ArrayRef<EnumEntry<SymbolKind>> getSymbolTypeNames() { 437 return makeArrayRef(SymbolTypeNames); 438 } 439 440 ArrayRef<EnumEntry<TypeLeafKind>> getTypeLeafNames() { 441 return makeArrayRef(TypeLeafNames); 442 } 443 444 ArrayRef<EnumEntry<uint16_t>> getRegisterNames(CPUType Cpu) { 445 if (Cpu == CPUType::ARMNT) { 446 return makeArrayRef(RegisterNames_ARM); 447 } else if (Cpu == CPUType::ARM64) { 448 return makeArrayRef(RegisterNames_ARM64); 449 } 450 return makeArrayRef(RegisterNames_X86); 451 } 452 453 ArrayRef<EnumEntry<uint32_t>> getPublicSymFlagNames() { 454 return makeArrayRef(PublicSymFlagNames); 455 } 456 457 ArrayRef<EnumEntry<uint8_t>> getProcSymFlagNames() { 458 return makeArrayRef(ProcSymFlagNames); 459 } 460 461 ArrayRef<EnumEntry<uint16_t>> getLocalFlagNames() { 462 return makeArrayRef(LocalFlags); 463 } 464 465 ArrayRef<EnumEntry<uint8_t>> getFrameCookieKindNames() { 466 return makeArrayRef(FrameCookieKinds); 467 } 468 469 ArrayRef<EnumEntry<SourceLanguage>> getSourceLanguageNames() { 470 return makeArrayRef(SourceLanguages); 471 } 472 473 ArrayRef<EnumEntry<uint32_t>> getCompileSym2FlagNames() { 474 return makeArrayRef(CompileSym2FlagNames); 475 } 476 477 ArrayRef<EnumEntry<uint32_t>> getCompileSym3FlagNames() { 478 return makeArrayRef(CompileSym3FlagNames); 479 } 480 481 ArrayRef<EnumEntry<uint32_t>> getFileChecksumNames() { 482 return makeArrayRef(FileChecksumNames); 483 } 484 485 ArrayRef<EnumEntry<unsigned>> getCPUTypeNames() { 486 return makeArrayRef(CPUTypeNames); 487 } 488 489 ArrayRef<EnumEntry<uint32_t>> getFrameProcSymFlagNames() { 490 return makeArrayRef(FrameProcSymFlagNames); 491 } 492 493 ArrayRef<EnumEntry<uint16_t>> getExportSymFlagNames() { 494 return makeArrayRef(ExportSymFlagNames); 495 } 496 497 ArrayRef<EnumEntry<uint32_t>> getModuleSubstreamKindNames() { 498 return makeArrayRef(ModuleSubstreamKindNames); 499 } 500 501 ArrayRef<EnumEntry<uint8_t>> getThunkOrdinalNames() { 502 return makeArrayRef(ThunkOrdinalNames); 503 } 504 505 ArrayRef<EnumEntry<uint16_t>> getTrampolineNames() { 506 return makeArrayRef(TrampolineNames); 507 } 508 509 ArrayRef<EnumEntry<COFF::SectionCharacteristics>> 510 getImageSectionCharacteristicNames() { 511 return makeArrayRef(ImageSectionCharacteristicNames); 512 } 513 514 ArrayRef<EnumEntry<uint16_t>> getClassOptionNames() { 515 return makeArrayRef(ClassOptionNames); 516 } 517 518 ArrayRef<EnumEntry<uint8_t>> getMemberAccessNames() { 519 return makeArrayRef(MemberAccessNames); 520 } 521 522 ArrayRef<EnumEntry<uint16_t>> getMethodOptionNames() { 523 return makeArrayRef(MethodOptionNames); 524 } 525 526 ArrayRef<EnumEntry<uint16_t>> getMemberKindNames() { 527 return makeArrayRef(MemberKindNames); 528 } 529 530 ArrayRef<EnumEntry<uint8_t>> getPtrKindNames() { 531 return makeArrayRef(PtrKindNames); 532 } 533 534 ArrayRef<EnumEntry<uint8_t>> getPtrModeNames() { 535 return makeArrayRef(PtrModeNames); 536 } 537 538 ArrayRef<EnumEntry<uint16_t>> getPtrMemberRepNames() { 539 return makeArrayRef(PtrMemberRepNames); 540 } 541 542 ArrayRef<EnumEntry<uint16_t>> getTypeModifierNames() { 543 return makeArrayRef(TypeModifierNames); 544 } 545 546 ArrayRef<EnumEntry<uint8_t>> getCallingConventions() { 547 return makeArrayRef(CallingConventions); 548 } 549 550 ArrayRef<EnumEntry<uint8_t>> getFunctionOptionEnum() { 551 return makeArrayRef(FunctionOptionEnum); 552 } 553 554 ArrayRef<EnumEntry<uint16_t>> getLabelTypeEnum() { 555 return makeArrayRef(LabelTypeEnum); 556 } 557 558 } // end namespace codeview 559 } // end namespace llvm 560