LLVM 22.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
64
75
89
96
112
124
139
146
212};
213
237
254
263
273
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
332
339
347
357
373
381
395
401
429
435
440
454
455namespace llvm {
456namespace codeview {
457
461
465
467 if (Cpu == CPUType::ARMNT) {
469 } else if (Cpu == CPUType::ARM64) {
471 }
473}
474
478
482
486
490
494
498
502
506
510
514
518
522
526
530
535
539
543
547
551
555
559
563
567
571
575
579
583
584} // end namespace codeview
585} // end namespace llvm
@ Generic
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static const EnumEntry< uint16_t > MemberKindNames[]
static const EnumEntry< uint16_t > RegisterNames_X86[]
static const EnumEntry< uint32_t > FrameProcSymFlagNames[]
static const EnumEntry< uint16_t > TypeModifierNames[]
static const EnumEntry< uint16_t > PtrMemberRepNames[]
static const EnumEntry< uint8_t > CallingConventions[]
static const EnumEntry< codeview::SourceLanguage > SourceLanguages[]
static const EnumEntry< uint8_t > FunctionOptionEnum[]
static const EnumEntry< TypeLeafKind > TypeLeafNames[]
static const EnumEntry< uint32_t > PublicSymFlagNames[]
static const EnumEntry< uint16_t > LabelTypeEnum[]
static const EnumEntry< uint32_t > FileChecksumNames[]
static const EnumEntry< uint16_t > MethodOptionNames[]
static const EnumEntry< unsigned > CPUTypeNames[]
static const EnumEntry< uint16_t > RegisterNames_ARM[]
#define CV_ENUM_ENT(ns, enum)
static const EnumEntry< uint8_t > ProcSymFlagNames[]
static const EnumEntry< uint16_t > TrampolineNames[]
static const EnumEntry< uint8_t > MemberAccessNames[]
static const EnumEntry< uint16_t > ExportSymFlagNames[]
static const EnumEntry< uint16_t > RegisterNames_ARM64[]
static const EnumEntry< COFF::SectionCharacteristics > ImageSectionCharacteristicNames[]
static const EnumEntry< uint32_t > CompileSym2FlagNames[]
static const EnumEntry< uint16_t > LocalFlags[]
static const EnumEntry< uint32_t > ModuleSubstreamKindNames[]
static const EnumEntry< uint16_t > JumpTableEntrySizeNames[]
static const EnumEntry< uint8_t > FrameCookieKinds[]
static const EnumEntry< uint8_t > PtrModeNames[]
static const EnumEntry< uint16_t > ClassOptionNames[]
static const EnumEntry< uint8_t > ThunkOrdinalNames[]
static const EnumEntry< uint32_t > CompileSym3FlagNames[]
static const EnumEntry< uint8_t > PtrKindNames[]
#define CV_ENUM_CLASS_ENT(enum_class, enum)
static const EnumEntry< SymbolKind > SymbolTypeNames[]
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
A class that wrap the SHA1 algorithm.
Definition SHA1.h:27
A table of densely packed, null-terminated strings indexed by offset.
Definition StringTable.h:33
@ Swift
Calling convention for Swift.
Definition CallingConv.h:69
@ C
The default llvm calling convention, compatible with C.
Definition CallingConv.h:34
This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM.
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getMethodOptionNames()
PointerMode
Equivalent to CV_ptrmode_e.
Definition CodeView.h:336
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
Definition CodeView.h:416
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Definition CodeView.h:389
MethodKind
Part of member attribute flags. (CV_methodprop_e)
Definition CodeView.h:253
LLVM_ABI ArrayRef< EnumEntry< uint8_t > > getCallingConventions()
LLVM_ABI ArrayRef< EnumEntry< uint8_t > > getMemberAccessNames()
LLVM_ABI ArrayRef< EnumEntry< uint8_t > > getPtrKindNames()
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
Definition CodeView.h:430
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getPtrMemberRepNames()
PointerKind
Equivalent to CV_ptrtype_e.
Definition CodeView.h:319
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
Definition CodeView.h:77
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
Definition CodeView.h:446
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getLabelTypeEnum()
LLVM_ABI ArrayRef< EnumEntry< uint32_t > > getCompileSym2FlagNames()
LLVM_ABI ArrayRef< EnumEntry< COFF::SectionCharacteristics > > getImageSectionCharacteristicNames()
PointerToMemberRepresentation
Equivalent to CV_pmtype_e.
Definition CodeView.h:359
LLVM_ABI ArrayRef< EnumEntry< uint32_t > > getFileChecksumNames()
LLVM_ABI ArrayRef< EnumEntry< TypeLeafKind > > getTypeLeafNames()
CallingConvention
These values correspond to the CV_call_e enumeration, and are documented at the following locations: ...
Definition CodeView.h:157
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getExportSymFlagNames()
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getJumpTableEntrySizeNames()
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getTypeModifierNames()
MethodOptions
Equivalent to CV_fldattr_t bitfield.
Definition CodeView.h:264
LLVM_ABI ArrayRef< EnumEntry< SymbolKind > > getSymbolTypeNames()
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getMemberKindNames()
MemberAccess
Source-level access specifier. (CV_access_e)
Definition CodeView.h:245
LLVM_ABI ArrayRef< EnumEntry< uint32_t > > getModuleSubstreamKindNames()
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition CodeView.h:537
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getLocalFlagNames()
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getRegisterNames(CPUType Cpu)
LLVM_ABI ArrayRef< EnumEntry< uint8_t > > getThunkOrdinalNames()
LLVM_ABI ArrayRef< EnumEntry< uint8_t > > getPtrModeNames()
LLVM_ABI ArrayRef< EnumEntry< uint8_t > > getProcSymFlagNames()
LLVM_ABI ArrayRef< EnumEntry< unsigned > > getCPUTypeNames()
LLVM_ABI ArrayRef< EnumEntry< uint8_t > > getFunctionOptionEnum()
ModifierOptions
Equivalent to CV_modifier_t.
Definition CodeView.h:284
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getClassOptionNames()
LLVM_ABI ArrayRef< EnumEntry< SourceLanguage > > getSourceLanguageNames()
LLVM_ABI ArrayRef< EnumEntry< uint32_t > > getFrameProcSymFlagNames()
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getTrampolineNames()
PublicSymFlags
Corresponds to the CV_PUBSYMFLAGS bitfield.
Definition CodeView.h:406
LabelType
Equivalent to CV_LABEL_TYPE_e.
Definition CodeView.h:277
SourceLanguage
These values correspond to the CV_CFL_LANG enumeration in the Microsoft Debug Interface Access SDK,...
Definition CodeView.h:147
LLVM_ABI ArrayRef< EnumEntry< uint32_t > > getPublicSymFlagNames()
LLVM_ABI ArrayRef< EnumEntry< uint32_t > > getCompileSym3FlagNames()
LLVM_ABI ArrayRef< EnumEntry< uint8_t > > getFrameCookieKindNames()
This is an optimization pass for GlobalISel generic memory operations.
ArrayRef(const T &OneElt) -> ArrayRef< T >
Data in the SUBSEC_FRAMEDATA subection.
Definition CodeView.h:558