LLVM 20.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
110 {"Swift", SourceLanguage::OldSwift},
111};
112
123};
124
138};
139
145};
146
212};
213
236};
237
253};
254
262};
263
272};
273
277};
278
281 CV_ENUM_ENT(COFF, IMAGE_SCN_TYPE_NOLOAD),
282 CV_ENUM_ENT(COFF, IMAGE_SCN_TYPE_NO_PAD),
283 CV_ENUM_ENT(COFF, IMAGE_SCN_CNT_CODE),
284 CV_ENUM_ENT(COFF, IMAGE_SCN_CNT_INITIALIZED_DATA),
285 CV_ENUM_ENT(COFF, IMAGE_SCN_CNT_UNINITIALIZED_DATA),
286 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_OTHER),
287 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_INFO),
288 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_REMOVE),
289 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_COMDAT),
290 CV_ENUM_ENT(COFF, IMAGE_SCN_GPREL),
291 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_PURGEABLE),
292 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_16BIT),
293 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_LOCKED),
294 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_PRELOAD),
295 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_1BYTES),
296 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_2BYTES),
297 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_4BYTES),
298 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_8BYTES),
299 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_16BYTES),
300 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_32BYTES),
301 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_64BYTES),
302 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_128BYTES),
303 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_256BYTES),
304 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_512BYTES),
305 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_1024BYTES),
306 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_2048BYTES),
307 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_4096BYTES),
308 CV_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_8192BYTES),
309 CV_ENUM_ENT(COFF, IMAGE_SCN_LNK_NRELOC_OVFL),
310 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_DISCARDABLE),
311 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_NOT_CACHED),
312 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_NOT_PAGED),
313 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_SHARED),
314 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_EXECUTE),
315 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_READ),
316 CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_WRITE)};
317
331};
332
338};
339
346};
347
356};
357
372};
373
380};
381
394};
395
400};
401
428};
429
434};
435
439};
440
453};
454
455namespace llvm {
456namespace codeview {
457
460}
461
463 return ArrayRef(TypeLeafNames);
464}
465
467 if (Cpu == CPUType::ARMNT) {
469 } else if (Cpu == CPUType::ARM64) {
471 }
473}
474
477}
478
481}
482
484 return ArrayRef(LocalFlags);
485}
486
489}
490
493}
494
497}
498
501}
502
505}
506
508 return ArrayRef(CPUTypeNames);
509}
510
513}
514
517}
518
521}
522
525}
526
529}
530
534}
535
538}
539
542}
543
546}
547
550}
551
553 return ArrayRef(PtrKindNames);
554}
555
557 return ArrayRef(PtrModeNames);
558}
559
562}
563
566}
567
570}
571
574}
575
577 return ArrayRef(LabelTypeEnum);
578}
579
582}
583
584} // end namespace codeview
585} // end namespace llvm
@ Generic
static const EnumEntry< uint16_t > MemberKindNames[]
Definition: EnumTables.cpp:348
static const EnumEntry< uint16_t > RegisterNames_X86[]
Definition: EnumTables.cpp:34
static const EnumEntry< uint32_t > FrameProcSymFlagNames[]
Definition: EnumTables.cpp:214
static const EnumEntry< uint16_t > TypeModifierNames[]
Definition: EnumTables.cpp:396
static const EnumEntry< uint16_t > PtrMemberRepNames[]
Definition: EnumTables.cpp:382
static const EnumEntry< uint8_t > CallingConventions[]
Definition: EnumTables.cpp:402
static const EnumEntry< codeview::SourceLanguage > SourceLanguages[]
Definition: EnumTables.cpp:97
static const EnumEntry< uint8_t > FunctionOptionEnum[]
Definition: EnumTables.cpp:430
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:436
static const EnumEntry< uint32_t > FileChecksumNames[]
Definition: EnumTables.cpp:140
static const EnumEntry< uint16_t > MethodOptionNames[]
Definition: EnumTables.cpp:340
static const EnumEntry< unsigned > CPUTypeNames[]
Definition: EnumTables.cpp:147
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:274
static const EnumEntry< uint8_t > MemberAccessNames[]
Definition: EnumTables.cpp:333
static const EnumEntry< uint16_t > ExportSymFlagNames[]
Definition: EnumTables.cpp:255
static const EnumEntry< uint16_t > RegisterNames_ARM64[]
Definition: EnumTables.cpp:50
static const EnumEntry< COFF::SectionCharacteristics > ImageSectionCharacteristicNames[]
Definition: EnumTables.cpp:280
static const EnumEntry< uint32_t > CompileSym2FlagNames[]
Definition: EnumTables.cpp:113
static const EnumEntry< uint16_t > LocalFlags[]
Definition: EnumTables.cpp:76
static const EnumEntry< uint32_t > ModuleSubstreamKindNames[]
Definition: EnumTables.cpp:238
static const EnumEntry< uint16_t > JumpTableEntrySizeNames[]
Definition: EnumTables.cpp:441
static const EnumEntry< uint8_t > FrameCookieKinds[]
Definition: EnumTables.cpp:90
static const EnumEntry< uint8_t > PtrModeNames[]
Definition: EnumTables.cpp:374
static const EnumEntry< uint16_t > ClassOptionNames[]
Definition: EnumTables.cpp:318
static const EnumEntry< uint8_t > ThunkOrdinalNames[]
Definition: EnumTables.cpp:264
static const EnumEntry< uint32_t > CompileSym3FlagNames[]
Definition: EnumTables.cpp:125
static const EnumEntry< uint8_t > PtrKindNames[]
Definition: EnumTables.cpp:358
#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:544
PointerMode
Equivalent to CV_ptrmode_e.
Definition: CodeView.h:363
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
Definition: CodeView.h:443
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Definition: CodeView.h:416
MethodKind
Part of member attribute flags. (CV_methodprop_e)
Definition: CodeView.h:280
ArrayRef< EnumEntry< uint8_t > > getCallingConventions()
Definition: EnumTables.cpp:568
ArrayRef< EnumEntry< uint8_t > > getMemberAccessNames()
Definition: EnumTables.cpp:540
ArrayRef< EnumEntry< uint8_t > > getPtrKindNames()
Definition: EnumTables.cpp:552
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
Definition: CodeView.h:457
ArrayRef< EnumEntry< uint16_t > > getPtrMemberRepNames()
Definition: EnumTables.cpp:560
PointerKind
Equivalent to CV_ptrtype_e.
Definition: CodeView.h:346
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
Definition: CodeView.h:76
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
Definition: CodeView.h:473
ArrayRef< EnumEntry< uint16_t > > getLabelTypeEnum()
Definition: EnumTables.cpp:576
ArrayRef< EnumEntry< uint32_t > > getCompileSym2FlagNames()
Definition: EnumTables.cpp:495
ArrayRef< EnumEntry< COFF::SectionCharacteristics > > getImageSectionCharacteristicNames()
Definition: EnumTables.cpp:532
PointerToMemberRepresentation
Equivalent to CV_pmtype_e.
Definition: CodeView.h:386
ArrayRef< EnumEntry< uint32_t > > getFileChecksumNames()
Definition: EnumTables.cpp:503
ArrayRef< EnumEntry< TypeLeafKind > > getTypeLeafNames()
Definition: EnumTables.cpp:462
ArrayRef< EnumEntry< uint16_t > > getExportSymFlagNames()
Definition: EnumTables.cpp:515
ArrayRef< EnumEntry< uint16_t > > getJumpTableEntrySizeNames()
Definition: EnumTables.cpp:580
ArrayRef< EnumEntry< uint16_t > > getTypeModifierNames()
Definition: EnumTables.cpp:564
MethodOptions
Equivalent to CV_fldattr_t bitfield.
Definition: CodeView.h:291
ArrayRef< EnumEntry< SymbolKind > > getSymbolTypeNames()
Definition: EnumTables.cpp:458
ArrayRef< EnumEntry< uint16_t > > getMemberKindNames()
Definition: EnumTables.cpp:548
MemberAccess
Source-level access specifier. (CV_access_e)
Definition: CodeView.h:272
ArrayRef< EnumEntry< uint32_t > > getModuleSubstreamKindNames()
Definition: EnumTables.cpp:519
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition: CodeView.h:563
ArrayRef< EnumEntry< uint16_t > > getLocalFlagNames()
Definition: EnumTables.cpp:483
ArrayRef< EnumEntry< uint16_t > > getRegisterNames(CPUType Cpu)
Definition: EnumTables.cpp:466
ArrayRef< EnumEntry< uint8_t > > getThunkOrdinalNames()
Definition: EnumTables.cpp:523
ArrayRef< EnumEntry< uint8_t > > getPtrModeNames()
Definition: EnumTables.cpp:556
ArrayRef< EnumEntry< uint8_t > > getProcSymFlagNames()
Definition: EnumTables.cpp:479
ArrayRef< EnumEntry< unsigned > > getCPUTypeNames()
Definition: EnumTables.cpp:507
ArrayRef< EnumEntry< uint8_t > > getFunctionOptionEnum()
Definition: EnumTables.cpp:572
ModifierOptions
Equivalent to CV_modifier_t.
Definition: CodeView.h:311
ArrayRef< EnumEntry< uint16_t > > getClassOptionNames()
Definition: EnumTables.cpp:536
ArrayRef< EnumEntry< SourceLanguage > > getSourceLanguageNames()
Definition: EnumTables.cpp:491
ArrayRef< EnumEntry< uint32_t > > getFrameProcSymFlagNames()
Definition: EnumTables.cpp:511
ArrayRef< EnumEntry< uint16_t > > getTrampolineNames()
Definition: EnumTables.cpp:527
PublicSymFlags
Corresponds to the CV_PUBSYMFLAGS bitfield.
Definition: CodeView.h:433
LabelType
Equivalent to CV_LABEL_TYPE_e.
Definition: CodeView.h:304
@ D
The DMD compiler emits 'D' for the CV source language.
Definition: CodeView.h:173
ArrayRef< EnumEntry< uint32_t > > getPublicSymFlagNames()
Definition: EnumTables.cpp:475
ArrayRef< EnumEntry< uint32_t > > getCompileSym3FlagNames()
Definition: EnumTables.cpp:499
ArrayRef< EnumEntry< uint8_t > > getFrameCookieKindNames()
Definition: EnumTables.cpp:487
CallingConvention
Definition: Dwarf.h:738
SourceLanguage
Definition: Dwarf.h:207
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Data in the SUBSEC_FRAMEDATA subection.
Definition: CodeView.h:584