LLVM  10.0.0svn
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 
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 
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_ARM64
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_ARM64
48 };
49 
55 };
56 
66 };
67 
68 static const EnumEntry<uint16_t> LocalFlags[] = {
80 };
81 
87 };
88 
100 };
101 
112 };
113 
127 };
128 
134 };
135 
197 };
198 
221 };
222 
238 };
239 
247 };
248 
250  CV_ENUM_CLASS_ENT(ThunkOrdinal, Standard),
257 };
258 
262 };
263 
302 
316 };
317 
323 };
324 
331 };
332 
336  CV_ENUM_CLASS_ENT(MethodKind, Static),
341 };
342 
357 };
358 
365 };
366 
379 };
380 
385 };
386 
412 };
413 
418 };
419 
423 };
424 
425 namespace llvm {
426 namespace codeview {
427 
429  return makeArrayRef(SymbolTypeNames);
430 }
431 
433  return makeArrayRef(TypeLeafNames);
434 }
435 
437  if (Cpu == CPUType::ARM64) {
438  return makeArrayRef(RegisterNames_ARM64);
439  }
440  return makeArrayRef(RegisterNames_X86);
441 }
442 
444  return makeArrayRef(PublicSymFlagNames);
445 }
446 
448  return makeArrayRef(ProcSymFlagNames);
449 }
450 
452  return makeArrayRef(LocalFlags);
453 }
454 
456  return makeArrayRef(FrameCookieKinds);
457 }
458 
460  return makeArrayRef(SourceLanguages);
461 }
462 
464  return makeArrayRef(CompileSym2FlagNames);
465 }
466 
468  return makeArrayRef(CompileSym3FlagNames);
469 }
470 
472  return makeArrayRef(FileChecksumNames);
473 }
474 
476  return makeArrayRef(CPUTypeNames);
477 }
478 
480  return makeArrayRef(FrameProcSymFlagNames);
481 }
482 
484  return makeArrayRef(ExportSymFlagNames);
485 }
486 
488  return makeArrayRef(ModuleSubstreamKindNames);
489 }
490 
492  return makeArrayRef(ThunkOrdinalNames);
493 }
494 
496  return makeArrayRef(TrampolineNames);
497 }
498 
502 }
503 
505  return makeArrayRef(ClassOptionNames);
506 }
507 
509  return makeArrayRef(MemberAccessNames);
510 }
511 
513  return makeArrayRef(MethodOptionNames);
514 }
515 
517  return makeArrayRef(MemberKindNames);
518 }
519 
521  return makeArrayRef(PtrKindNames);
522 }
523 
525  return makeArrayRef(PtrModeNames);
526 }
527 
529  return makeArrayRef(PtrMemberRepNames);
530 }
531 
533  return makeArrayRef(TypeModifierNames);
534 }
535 
537  return makeArrayRef(CallingConventions);
538 }
539 
541  return makeArrayRef(FunctionOptionEnum);
542 }
543 
545  return makeArrayRef(LabelTypeEnum);
546 }
547 
548 } // end namespace codeview
549 } // end namespace llvm
const NoneType None
Definition: None.h:23
PointerKind
Equivalent to CV_ptrtype_e.
Definition: CodeView.h:331
static const EnumEntry< uint8_t > FunctionOptionEnum[]
Definition: EnumTables.cpp:414
ArrayRef< EnumEntry< uint32_t > > getModuleSubstreamKindNames()
Definition: EnumTables.cpp:487
static const EnumEntry< uint16_t > TrampolineNames[]
Definition: EnumTables.cpp:259
static const EnumEntry< uint32_t > ModuleSubstreamKindNames[]
Definition: EnumTables.cpp:223
This class represents lattice values for constants.
Definition: AllocatorList.h:23
ArrayRef< EnumEntry< uint16_t > > getExportSymFlagNames()
Definition: EnumTables.cpp:483
ArrayRef< EnumEntry< uint16_t > > getTypeModifierNames()
Definition: EnumTables.cpp:532
ArrayRef< EnumEntry< uint32_t > > getCompileSym3FlagNames()
Definition: EnumTables.cpp:467
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
Definition: CodeView.h:458
static const EnumEntry< uint32_t > FrameProcSymFlagNames[]
Definition: EnumTables.cpp:199
Data in the SUBSEC_FRAMEDATA subection.
Definition: CodeView.h:569
static const EnumEntry< uint8_t > ProcSymFlagNames[]
Definition: EnumTables.cpp:57
static const EnumEntry< uint32_t > PublicSymFlagNames[]
Definition: EnumTables.cpp:50
ArrayRef< EnumEntry< uint16_t > > getRegisterNames(CPUType Cpu)
Definition: EnumTables.cpp:436
A class that wrap the SHA1 algorithm.
Definition: SHA1.h:28
static const EnumEntry< uint16_t > MemberKindNames[]
Definition: EnumTables.cpp:333
ArrayRef< EnumEntry< uint16_t > > getClassOptionNames()
Definition: EnumTables.cpp:504
static const EnumEntry< uint8_t > MemberAccessNames[]
Definition: EnumTables.cpp:318
ArrayRef< EnumEntry< TypeLeafKind > > getTypeLeafNames()
Definition: EnumTables.cpp:432
ArrayRef< EnumEntry< uint32_t > > getPublicSymFlagNames()
Definition: EnumTables.cpp:443
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Definition: ArrayRef.h:450
ArrayRef< EnumEntry< uint8_t > > getThunkOrdinalNames()
Definition: EnumTables.cpp:491
ArrayRef< EnumEntry< uint8_t > > getPtrKindNames()
Definition: EnumTables.cpp:520
ArrayRef< EnumEntry< uint8_t > > getFrameCookieKindNames()
Definition: EnumTables.cpp:455
ModifierOptions
Equivalent to CV_modifier_t.
Definition: CodeView.h:299
#define CV_ENUM_ENT(ns, enum)
Definition: EnumTables.cpp:19
LabelType
Equivalent to CV_LABEL_TYPE_e.
Definition: CodeView.h:292
PublicSymFlags
Corresponds to the CV_PUBSYMFLAGS bitfield.
Definition: CodeView.h:418
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
ArrayRef< EnumEntry< COFF::SectionCharacteristics > > getImageSectionCharacteristicNames()
Definition: EnumTables.cpp:500
MethodKind
Part of member attribute flags. (CV_methodprop_e)
Definition: CodeView.h:268
static const EnumEntry< codeview::SourceLanguage > SourceLanguages[]
Definition: EnumTables.cpp:89
static const EnumEntry< uint16_t > TypeModifierNames[]
Definition: EnumTables.cpp:381
static const EnumEntry< TypeLeafKind > TypeLeafNames[]
Definition: EnumTables.cpp:28
ArrayRef< EnumEntry< uint16_t > > getLabelTypeEnum()
Definition: EnumTables.cpp:544
ArrayRef< EnumEntry< unsigned > > getCPUTypeNames()
Definition: EnumTables.cpp:475
ArrayRef< EnumEntry< uint16_t > > getPtrMemberRepNames()
Definition: EnumTables.cpp:528
static const EnumEntry< uint32_t > CompileSym2FlagNames[]
Definition: EnumTables.cpp:102
static const EnumEntry< uint8_t > FrameCookieKinds[]
Definition: EnumTables.cpp:82
static const EnumEntry< unsigned > CPUTypeNames[]
Definition: EnumTables.cpp:136
static const EnumEntry< uint16_t > RegisterNames_X86[]
Definition: EnumTables.cpp:34
ArrayRef< EnumEntry< uint16_t > > getMethodOptionNames()
Definition: EnumTables.cpp:512
ArrayRef< EnumEntry< uint8_t > > getFunctionOptionEnum()
Definition: EnumTables.cpp:540
ArrayRef< EnumEntry< uint8_t > > getPtrModeNames()
Definition: EnumTables.cpp:524
ArrayRef< EnumEntry< uint32_t > > getFileChecksumNames()
Definition: EnumTables.cpp:471
SourceLanguage
These values correspond to the CV_CFL_LANG enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx.
Definition: CodeView.h:143
ArrayRef< EnumEntry< uint32_t > > getFrameProcSymFlagNames()
Definition: EnumTables.cpp:479
static const EnumEntry< uint16_t > PtrMemberRepNames[]
Definition: EnumTables.cpp:367
static const EnumEntry< uint8_t > PtrKindNames[]
Definition: EnumTables.cpp:343
static const EnumEntry< SymbolKind > SymbolTypeNames[]
Definition: EnumTables.cpp:22
ArrayRef< EnumEntry< SymbolKind > > getSymbolTypeNames()
Definition: EnumTables.cpp:428
The DMD & Swift compilers emit &#39;D&#39; and &#39;S&#39;, respectively, for the CV source language. ...
Definition: CodeView.h:164
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn...
Definition: CodeView.h:78
ArrayRef< EnumEntry< uint8_t > > getProcSymFlagNames()
Definition: EnumTables.cpp:447
ArrayRef< EnumEntry< SourceLanguage > > getSourceLanguageNames()
Definition: EnumTables.cpp:459
static const EnumEntry< uint16_t > LocalFlags[]
Definition: EnumTables.cpp:68
static const EnumEntry< uint16_t > ExportSymFlagNames[]
Definition: EnumTables.cpp:240
ArrayRef< EnumEntry< uint32_t > > getCompileSym2FlagNames()
Definition: EnumTables.cpp:463
PointerMode
Equivalent to CV_ptrmode_e.
Definition: CodeView.h:348
static const EnumEntry< uint8_t > PtrModeNames[]
Definition: EnumTables.cpp:359
static const EnumEntry< uint32_t > FileChecksumNames[]
Definition: EnumTables.cpp:129
static const EnumEntry< uint8_t > ThunkOrdinalNames[]
Definition: EnumTables.cpp:249
ArrayRef< EnumEntry< uint16_t > > getTrampolineNames()
Definition: EnumTables.cpp:495
MethodOptions
Equivalent to CV_fldattr_t bitfield.
Definition: CodeView.h:279
#define CV_ENUM_CLASS_ENT(enum_class, enum)
Definition: EnumTables.cpp:16
static const EnumEntry< uint16_t > LabelTypeEnum[]
Definition: EnumTables.cpp:420
ArrayRef< EnumEntry< uint8_t > > getMemberAccessNames()
Definition: EnumTables.cpp:508
static const EnumEntry< uint32_t > CompileSym3FlagNames[]
Definition: EnumTables.cpp:114
static const EnumEntry< uint8_t > CallingConventions[]
Definition: EnumTables.cpp:387
ArrayRef< EnumEntry< uint16_t > > getMemberKindNames()
Definition: EnumTables.cpp:516
Definition: MD5.h:41
static const EnumEntry< uint16_t > MethodOptionNames[]
Definition: EnumTables.cpp:325
static const EnumEntry< COFF::SectionCharacteristics > ImageSectionCharacteristicNames[]
Definition: EnumTables.cpp:265
PointerToMemberRepresentation
Equivalent to CV_pmtype_e.
Definition: CodeView.h:371
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition: CodeView.h:548
MemberAccess
Source-level access specifier. (CV_access_e)
Definition: CodeView.h:260
CallingConvention
These values correspond to the CV_call_e enumeration, and are documented at the following locations: ...
Definition: CodeView.h:173
static const EnumEntry< uint16_t > ClassOptionNames[]
Definition: EnumTables.cpp:303
static const EnumEntry< uint16_t > RegisterNames_ARM64[]
Definition: EnumTables.cpp:42
ArrayRef< EnumEntry< uint16_t > > getLocalFlagNames()
Definition: EnumTables.cpp:451
ArrayRef< EnumEntry< uint8_t > > getCallingConventions()
Definition: EnumTables.cpp:536
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
Definition: CodeView.h:428
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Definition: CodeView.h:401
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
Definition: CodeView.h:442