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 
303 namespace llvm {
304 namespace codeview {
305 
307  return makeArrayRef(SymbolTypeNames);
308 }
309 
311  return makeArrayRef(TypeLeafNames);
312 }
313 
315  if (Cpu == CPUType::ARM64) {
316  return makeArrayRef(RegisterNames_ARM64);
317  }
318  return makeArrayRef(RegisterNames_X86);
319 }
320 
322  return makeArrayRef(PublicSymFlagNames);
323 }
324 
326  return makeArrayRef(ProcSymFlagNames);
327 }
328 
330  return makeArrayRef(LocalFlags);
331 }
332 
334  return makeArrayRef(FrameCookieKinds);
335 }
336 
338  return makeArrayRef(SourceLanguages);
339 }
340 
342  return makeArrayRef(CompileSym2FlagNames);
343 }
344 
346  return makeArrayRef(CompileSym3FlagNames);
347 }
348 
350  return makeArrayRef(FileChecksumNames);
351 }
352 
354  return makeArrayRef(CPUTypeNames);
355 }
356 
358  return makeArrayRef(FrameProcSymFlagNames);
359 }
360 
362  return makeArrayRef(ExportSymFlagNames);
363 }
364 
366  return makeArrayRef(ModuleSubstreamKindNames);
367 }
368 
370  return makeArrayRef(ThunkOrdinalNames);
371 }
372 
374  return makeArrayRef(TrampolineNames);
375 }
376 
380 }
381 
382 } // end namespace codeview
383 } // end namespace llvm
const NoneType None
Definition: None.h:23
ArrayRef< EnumEntry< uint32_t > > getModuleSubstreamKindNames()
Definition: EnumTables.cpp:365
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:361
ArrayRef< EnumEntry< uint32_t > > getCompileSym3FlagNames()
Definition: EnumTables.cpp:345
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:314
A class that wrap the SHA1 algorithm.
Definition: SHA1.h:28
ArrayRef< EnumEntry< TypeLeafKind > > getTypeLeafNames()
Definition: EnumTables.cpp:310
ArrayRef< EnumEntry< uint32_t > > getPublicSymFlagNames()
Definition: EnumTables.cpp:321
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:369
ArrayRef< EnumEntry< uint8_t > > getFrameCookieKindNames()
Definition: EnumTables.cpp:333
#define CV_ENUM_ENT(ns, enum)
Definition: EnumTables.cpp:19
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:378
static const EnumEntry< codeview::SourceLanguage > SourceLanguages[]
Definition: EnumTables.cpp:89
static const EnumEntry< TypeLeafKind > TypeLeafNames[]
Definition: EnumTables.cpp:28
ArrayRef< EnumEntry< unsigned > > getCPUTypeNames()
Definition: EnumTables.cpp:353
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< uint32_t > > getFileChecksumNames()
Definition: EnumTables.cpp:349
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:357
static const EnumEntry< SymbolKind > SymbolTypeNames[]
Definition: EnumTables.cpp:22
ArrayRef< EnumEntry< SymbolKind > > getSymbolTypeNames()
Definition: EnumTables.cpp:306
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:325
ArrayRef< EnumEntry< SourceLanguage > > getSourceLanguageNames()
Definition: EnumTables.cpp:337
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:341
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:373
#define CV_ENUM_CLASS_ENT(enum_class, enum)
Definition: EnumTables.cpp:16
static const EnumEntry< uint32_t > CompileSym3FlagNames[]
Definition: EnumTables.cpp:114
Definition: MD5.h:41
static const EnumEntry< COFF::SectionCharacteristics > ImageSectionCharacteristicNames[]
Definition: EnumTables.cpp:265
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition: CodeView.h:548
static const EnumEntry< uint16_t > RegisterNames_ARM64[]
Definition: EnumTables.cpp:42
ArrayRef< EnumEntry< uint16_t > > getLocalFlagNames()
Definition: EnumTables.cpp:329
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