LLVM 17.0.0git
EnumTables.cpp
Go to the documentation of this file.
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
11#include <type_traits>
12
13using namespace llvm;
14using namespace codeview;
15
16#define CV_ENUM_CLASS_ENT(enum_class, enum) \
17 { #enum, std::underlying_type_t<enum_class>(enum_class::enum) }
18
19#define CV_ENUM_ENT(ns, enum) \
20 { #enum, ns::enum }
21
23#define CV_SYMBOL(enum, val) {#enum, enum},
24#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
25#undef CV_SYMBOL
26};
27
29#define CV_TYPE(name, val) {#name, name},
30#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
31#undef CV_TYPE
32};
33
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
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
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
63};
64
74};
75
88};
89
95};
96
108};
109
120};
121
135};
136
142};
143
208};
209
232};
233
249};
250
258};
259
268};
269
273};
274
277 CV_ENUM_ENT(COFF, IMAGE_SCN_TYPE_NOLOAD),
278 CV_ENUM_ENT(COFF, IMAGE_SCN_TYPE_NO_PAD),
279 CV_ENUM_ENT(COFF, IMAGE_SCN_CNT_CODE),
280 CV_ENUM_ENT(COFF, IMAGE_SCN_CNT_INITIALIZED_DATA),
281 CV_ENUM_ENT(COFF, IMAGE_SCN_CNT_UNINITIALIZED_DATA),
282 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_OTHER),
283 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_INFO),
284 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_REMOVE),
285 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_COMDAT),
286 CV_ENUM_ENT(COFF, IMAGE_SCN_GPREL),
287 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_PURGEABLE),
288 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_16BIT),
289 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_LOCKED),
290 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_PRELOAD),
291 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_1BYTES),
292 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_2BYTES),
293 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_4BYTES),
294 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_8BYTES),
295 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_16BYTES),
296 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_32BYTES),
297 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_64BYTES),
298 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_128BYTES),
299 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_256BYTES),
300 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_512BYTES),
301 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_1024BYTES),
302 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_2048BYTES),
303 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_4096BYTES),
304 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_8192BYTES),
305 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_NRELOC_OVFL),
306 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_DISCARDABLE),
307 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_NOT_CACHED),
308 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_NOT_PAGED),
309 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_SHARED),
310 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_EXECUTE),
311 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_READ),
312 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_WRITE)};
313
327};
328
334};
335
342};
343
352};
353
368};
369
376};
377
390};
391
396};
397
423};
424
429};
430
434};
435
436namespace llvm {
437namespace codeview {
438
441}
442
444 return ArrayRef(TypeLeafNames);
445}
446
448 if (Cpu == CPUType::ARMNT) {
450 } else if (Cpu == CPUType::ARM64) {
452 }
454}
455
458}
459
462}
463
465 return ArrayRef(LocalFlags);
466}
467
470}
471
474}
475
478}
479
482}
483
486}
487
489 return ArrayRef(CPUTypeNames);
490}
491
494}
495
498}
499
502}
503
506}
507
510}
511
515}
516
519}
520
523}
524
527}
528
531}
532
534 return ArrayRef(PtrKindNames);
535}
536
538 return ArrayRef(PtrModeNames);
539}
540
543}
544
547}
548
551}
552
555}
556
558 return ArrayRef(LabelTypeEnum);
559}
560
561} // end namespace codeview
562} // end namespace llvm
@ Generic
static const EnumEntry< uint16_t > MemberKindNames[]
Definition: EnumTables.cpp:344
static const EnumEntry< uint16_t > RegisterNames_X86[]
Definition: EnumTables.cpp:34
static const EnumEntry< uint32_t > FrameProcSymFlagNames[]
Definition: EnumTables.cpp:210
static const EnumEntry< uint16_t > TypeModifierNames[]
Definition: EnumTables.cpp:392
static const EnumEntry< uint16_t > PtrMemberRepNames[]
Definition: EnumTables.cpp:378
static const EnumEntry< uint8_t > CallingConventions[]
Definition: EnumTables.cpp:398
static const EnumEntry< codeview::SourceLanguage > SourceLanguages[]
Definition: EnumTables.cpp:97
static const EnumEntry< uint8_t > FunctionOptionEnum[]
Definition: EnumTables.cpp:425
static const EnumEntry< TypeLeafKind > TypeLeafNames[]
Definition: EnumTables.cpp:28
static const EnumEntry< uint32_t > PublicSymFlagNames[]
Definition: EnumTables.cpp:58
static const EnumEntry< uint16_t > LabelTypeEnum[]
Definition: EnumTables.cpp:431
static const EnumEntry< uint32_t > FileChecksumNames[]
Definition: EnumTables.cpp:137
static const EnumEntry< uint16_t > MethodOptionNames[]
Definition: EnumTables.cpp:336
static const EnumEntry< unsigned > CPUTypeNames[]
Definition: EnumTables.cpp:144
static const EnumEntry< uint16_t > RegisterNames_ARM[]
Definition: EnumTables.cpp:42
#define CV_ENUM_ENT(ns, enum)
Definition: EnumTables.cpp:19
static const EnumEntry< uint8_t > ProcSymFlagNames[]
Definition: EnumTables.cpp:65
static const EnumEntry< uint16_t > TrampolineNames[]
Definition: EnumTables.cpp:270
static const EnumEntry< uint8_t > MemberAccessNames[]
Definition: EnumTables.cpp:329
static const EnumEntry< uint16_t > ExportSymFlagNames[]
Definition: EnumTables.cpp:251
static const EnumEntry< uint16_t > RegisterNames_ARM64[]
Definition: EnumTables.cpp:50
static const EnumEntry< COFF::SectionCharacteristics > ImageSectionCharacteristicNames[]
Definition: EnumTables.cpp:276
static const EnumEntry< uint32_t > CompileSym2FlagNames[]
Definition: EnumTables.cpp:110
static const EnumEntry< uint16_t > LocalFlags[]
Definition: EnumTables.cpp:76
static const EnumEntry< uint32_t > ModuleSubstreamKindNames[]
Definition: EnumTables.cpp:234
static const EnumEntry< uint8_t > FrameCookieKinds[]
Definition: EnumTables.cpp:90
static const EnumEntry< uint8_t > PtrModeNames[]
Definition: EnumTables.cpp:370
static const EnumEntry< uint16_t > ClassOptionNames[]
Definition: EnumTables.cpp:314
static const EnumEntry< uint8_t > ThunkOrdinalNames[]
Definition: EnumTables.cpp:260
static const EnumEntry< uint32_t > CompileSym3FlagNames[]
Definition: EnumTables.cpp:122
static const EnumEntry< uint8_t > PtrKindNames[]
Definition: EnumTables.cpp:354
#define CV_ENUM_CLASS_ENT(enum_class, enum)
Definition: EnumTables.cpp:16
static const EnumEntry< SymbolKind > SymbolTypeNames[]
Definition: EnumTables.cpp:22
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
Definition: MD5.h:41
A class that wrap the SHA1 algorithm.
Definition: SHA1.h:26
ArrayRef< EnumEntry< uint16_t > > getMethodOptionNames()
Definition: EnumTables.cpp:525
PointerMode
Equivalent to CV_ptrmode_e.
Definition: CodeView.h:353
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
Definition: CodeView.h:433
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Definition: CodeView.h:406
MethodKind
Part of member attribute flags. (CV_methodprop_e)
Definition: CodeView.h:270
ArrayRef< EnumEntry< uint8_t > > getCallingConventions()
Definition: EnumTables.cpp:549
ArrayRef< EnumEntry< uint8_t > > getMemberAccessNames()
Definition: EnumTables.cpp:521
ArrayRef< EnumEntry< uint8_t > > getPtrKindNames()
Definition: EnumTables.cpp:533
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
Definition: CodeView.h:447
ArrayRef< EnumEntry< uint16_t > > getPtrMemberRepNames()
Definition: EnumTables.cpp:541
PointerKind
Equivalent to CV_ptrtype_e.
Definition: CodeView.h:336
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
Definition: CodeView.h:75
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
Definition: CodeView.h:463
ArrayRef< EnumEntry< uint16_t > > getLabelTypeEnum()
Definition: EnumTables.cpp:557
ArrayRef< EnumEntry< uint32_t > > getCompileSym2FlagNames()
Definition: EnumTables.cpp:476
ArrayRef< EnumEntry< COFF::SectionCharacteristics > > getImageSectionCharacteristicNames()
Definition: EnumTables.cpp:513
PointerToMemberRepresentation
Equivalent to CV_pmtype_e.
Definition: CodeView.h:376
ArrayRef< EnumEntry< uint32_t > > getFileChecksumNames()
Definition: EnumTables.cpp:484
ArrayRef< EnumEntry< TypeLeafKind > > getTypeLeafNames()
Definition: EnumTables.cpp:443
ArrayRef< EnumEntry< uint16_t > > getExportSymFlagNames()
Definition: EnumTables.cpp:496
ArrayRef< EnumEntry< uint16_t > > getTypeModifierNames()
Definition: EnumTables.cpp:545
MethodOptions
Equivalent to CV_fldattr_t bitfield.
Definition: CodeView.h:281
ArrayRef< EnumEntry< SymbolKind > > getSymbolTypeNames()
Definition: EnumTables.cpp:439
ArrayRef< EnumEntry< uint16_t > > getMemberKindNames()
Definition: EnumTables.cpp:529
MemberAccess
Source-level access specifier. (CV_access_e)
Definition: CodeView.h:262
ArrayRef< EnumEntry< uint32_t > > getModuleSubstreamKindNames()
Definition: EnumTables.cpp:500
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition: CodeView.h:553
ArrayRef< EnumEntry< uint16_t > > getLocalFlagNames()
Definition: EnumTables.cpp:464
ArrayRef< EnumEntry< uint16_t > > getRegisterNames(CPUType Cpu)
Definition: EnumTables.cpp:447
ArrayRef< EnumEntry< uint8_t > > getThunkOrdinalNames()
Definition: EnumTables.cpp:504
ArrayRef< EnumEntry< uint8_t > > getPtrModeNames()
Definition: EnumTables.cpp:537
ArrayRef< EnumEntry< uint8_t > > getProcSymFlagNames()
Definition: EnumTables.cpp:460
ArrayRef< EnumEntry< unsigned > > getCPUTypeNames()
Definition: EnumTables.cpp:488
ArrayRef< EnumEntry< uint8_t > > getFunctionOptionEnum()
Definition: EnumTables.cpp:553
ModifierOptions
Equivalent to CV_modifier_t.
Definition: CodeView.h:301
ArrayRef< EnumEntry< uint16_t > > getClassOptionNames()
Definition: EnumTables.cpp:517
ArrayRef< EnumEntry< SourceLanguage > > getSourceLanguageNames()
Definition: EnumTables.cpp:472
ArrayRef< EnumEntry< uint32_t > > getFrameProcSymFlagNames()
Definition: EnumTables.cpp:492
ArrayRef< EnumEntry< uint16_t > > getTrampolineNames()
Definition: EnumTables.cpp:508
PublicSymFlags
Corresponds to the CV_PUBSYMFLAGS bitfield.
Definition: CodeView.h:423
LabelType
Equivalent to CV_LABEL_TYPE_e.
Definition: CodeView.h:294
@ D
The DMD & Swift compilers emit 'D' and 'S', respectively, for the CV source language.
Definition: CodeView.h:166
ArrayRef< EnumEntry< uint32_t > > getPublicSymFlagNames()
Definition: EnumTables.cpp:456
ArrayRef< EnumEntry< uint32_t > > getCompileSym3FlagNames()
Definition: EnumTables.cpp:480
ArrayRef< EnumEntry< uint8_t > > getFrameCookieKindNames()
Definition: EnumTables.cpp:468
CallingConvention
Definition: Dwarf.h:413
SourceLanguage
Definition: Dwarf.h:199
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
constexpr std::nullopt_t None
Definition: None.h:28
Data in the SUBSEC_FRAMEDATA subection.
Definition: CodeView.h:574