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
9#include "llvm/DebugInfo/CodeView/EnumTables.h"
10#include "llvm/Support/ScopedPrinter.h"
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
22static const EnumEntry<SymbolKind> SymbolTypeNames[] = {
23#define CV_SYMBOL(enum, val) {#enum, enum},
24#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
25#undef CV_SYMBOL
26};
27
28static const EnumEntry<TypeLeafKind> TypeLeafNames[] = {
29#define CV_TYPE(name, val) {#name, name},
30#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
31#undef CV_TYPE
32};
33
34static const EnumEntry<uint16_t> RegisterNames_X86[] = {
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
42static const EnumEntry<uint16_t> RegisterNames_ARM[] = {
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
50static const EnumEntry<uint16_t> RegisterNames_ARM64[] = {
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
58static const EnumEntry<uint32_t> PublicSymFlagNames[] = {
59 CV_ENUM_CLASS_ENT(PublicSymFlags, Code),
60 CV_ENUM_CLASS_ENT(PublicSymFlags, Function),
61 CV_ENUM_CLASS_ENT(PublicSymFlags, Managed),
62 CV_ENUM_CLASS_ENT(PublicSymFlags, MSIL),
63};
64
65static const EnumEntry<uint8_t> ProcSymFlagNames[] = {
66 CV_ENUM_CLASS_ENT(ProcSymFlags, HasFP),
67 CV_ENUM_CLASS_ENT(ProcSymFlags, HasIRET),
68 CV_ENUM_CLASS_ENT(ProcSymFlags, HasFRET),
69 CV_ENUM_CLASS_ENT(ProcSymFlags, IsNoReturn),
70 CV_ENUM_CLASS_ENT(ProcSymFlags, IsUnreachable),
71 CV_ENUM_CLASS_ENT(ProcSymFlags, HasCustomCallingConv),
72 CV_ENUM_CLASS_ENT(ProcSymFlags, IsNoInline),
73 CV_ENUM_CLASS_ENT(ProcSymFlags, HasOptimizedDebugInfo),
74};
75
76static const EnumEntry<uint16_t> LocalFlags[] = {
77 CV_ENUM_CLASS_ENT(LocalSymFlags, IsParameter),
78 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAddressTaken),
79 CV_ENUM_CLASS_ENT(LocalSymFlags, IsCompilerGenerated),
80 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAggregate),
81 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAggregated),
82 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAliased),
83 CV_ENUM_CLASS_ENT(LocalSymFlags, IsAlias),
84 CV_ENUM_CLASS_ENT(LocalSymFlags, IsReturnValue),
85 CV_ENUM_CLASS_ENT(LocalSymFlags, IsOptimizedOut),
86 CV_ENUM_CLASS_ENT(LocalSymFlags, IsEnregisteredGlobal),
87 CV_ENUM_CLASS_ENT(LocalSymFlags, IsEnregisteredStatic),
88};
89
90static const EnumEntry<uint8_t> FrameCookieKinds[] = {
91 CV_ENUM_CLASS_ENT(FrameCookieKind, Copy),
92 CV_ENUM_CLASS_ENT(FrameCookieKind, XorStackPointer),
93 CV_ENUM_CLASS_ENT(FrameCookieKind, XorFramePointer),
94 CV_ENUM_CLASS_ENT(FrameCookieKind, XorR13),
95};
96
97static const EnumEntry<codeview::SourceLanguage> SourceLanguages[] = {
98 CV_ENUM_ENT(SourceLanguage, C), CV_ENUM_ENT(SourceLanguage, Cpp),
99 CV_ENUM_ENT(SourceLanguage, Fortran), CV_ENUM_ENT(SourceLanguage, Masm),
100 CV_ENUM_ENT(SourceLanguage, Pascal), CV_ENUM_ENT(SourceLanguage, Basic),
101 CV_ENUM_ENT(SourceLanguage, Cobol), CV_ENUM_ENT(SourceLanguage, Link),
102 CV_ENUM_ENT(SourceLanguage, Cvtres), CV_ENUM_ENT(SourceLanguage, Cvtpgd),
103 CV_ENUM_ENT(SourceLanguage, CSharp), CV_ENUM_ENT(SourceLanguage, VB),
104 CV_ENUM_ENT(SourceLanguage, ILAsm), CV_ENUM_ENT(SourceLanguage, Java),
105 CV_ENUM_ENT(SourceLanguage, JScript), CV_ENUM_ENT(SourceLanguage, MSIL),
106 CV_ENUM_ENT(SourceLanguage, HLSL), CV_ENUM_ENT(SourceLanguage, D),
107 CV_ENUM_ENT(SourceLanguage, Swift), CV_ENUM_ENT(SourceLanguage, Rust),
108 CV_ENUM_ENT(SourceLanguage, ObjC), CV_ENUM_ENT(SourceLanguage, ObjCpp),
109 CV_ENUM_ENT(SourceLanguage, AliasObj), CV_ENUM_ENT(SourceLanguage, Go),
110 {"Swift", SourceLanguage::OldSwift},
111};
112
113static const EnumEntry<uint32_t> CompileSym2FlagNames[] = {
114 CV_ENUM_CLASS_ENT(CompileSym2Flags, EC),
115 CV_ENUM_CLASS_ENT(CompileSym2Flags, NoDbgInfo),
116 CV_ENUM_CLASS_ENT(CompileSym2Flags, LTCG),
117 CV_ENUM_CLASS_ENT(CompileSym2Flags, NoDataAlign),
118 CV_ENUM_CLASS_ENT(CompileSym2Flags, ManagedPresent),
119 CV_ENUM_CLASS_ENT(CompileSym2Flags, SecurityChecks),
120 CV_ENUM_CLASS_ENT(CompileSym2Flags, HotPatch),
121 CV_ENUM_CLASS_ENT(CompileSym2Flags, CVTCIL),
122 CV_ENUM_CLASS_ENT(CompileSym2Flags, MSILModule),
123};
124
125static const EnumEntry<uint32_t> CompileSym3FlagNames[] = {
126 CV_ENUM_CLASS_ENT(CompileSym3Flags, EC),
127 CV_ENUM_CLASS_ENT(CompileSym3Flags, NoDbgInfo),
128 CV_ENUM_CLASS_ENT(CompileSym3Flags, LTCG),
129 CV_ENUM_CLASS_ENT(CompileSym3Flags, NoDataAlign),
130 CV_ENUM_CLASS_ENT(CompileSym3Flags, ManagedPresent),
131 CV_ENUM_CLASS_ENT(CompileSym3Flags, SecurityChecks),
132 CV_ENUM_CLASS_ENT(CompileSym3Flags, HotPatch),
133 CV_ENUM_CLASS_ENT(CompileSym3Flags, CVTCIL),
134 CV_ENUM_CLASS_ENT(CompileSym3Flags, MSILModule),
135 CV_ENUM_CLASS_ENT(CompileSym3Flags, Sdl),
136 CV_ENUM_CLASS_ENT(CompileSym3Flags, PGO),
137 CV_ENUM_CLASS_ENT(CompileSym3Flags, Exp),
138};
139
140static const EnumEntry<uint32_t> FileChecksumNames[] = {
141 CV_ENUM_CLASS_ENT(FileChecksumKind, None),
142 CV_ENUM_CLASS_ENT(FileChecksumKind, MD5),
143 CV_ENUM_CLASS_ENT(FileChecksumKind, SHA1),
144 CV_ENUM_CLASS_ENT(FileChecksumKind, SHA256),
145};
146
147static const EnumEntry<unsigned> CPUTypeNames[] = {
148 CV_ENUM_CLASS_ENT(CPUType, Intel8080),
149 CV_ENUM_CLASS_ENT(CPUType, Intel8086),
150 CV_ENUM_CLASS_ENT(CPUType, Intel80286),
151 CV_ENUM_CLASS_ENT(CPUType, Intel80386),
152 CV_ENUM_CLASS_ENT(CPUType, Intel80486),
153 CV_ENUM_CLASS_ENT(CPUType, Pentium),
154 CV_ENUM_CLASS_ENT(CPUType, PentiumPro),
155 CV_ENUM_CLASS_ENT(CPUType, Pentium3),
156 CV_ENUM_CLASS_ENT(CPUType, MIPS),
157 CV_ENUM_CLASS_ENT(CPUType, MIPS16),
158 CV_ENUM_CLASS_ENT(CPUType, MIPS32),
159 CV_ENUM_CLASS_ENT(CPUType, MIPS64),
160 CV_ENUM_CLASS_ENT(CPUType, MIPSI),
161 CV_ENUM_CLASS_ENT(CPUType, MIPSII),
162 CV_ENUM_CLASS_ENT(CPUType, MIPSIII),
163 CV_ENUM_CLASS_ENT(CPUType, MIPSIV),
164 CV_ENUM_CLASS_ENT(CPUType, MIPSV),
165 CV_ENUM_CLASS_ENT(CPUType, M68000),
166 CV_ENUM_CLASS_ENT(CPUType, M68010),
167 CV_ENUM_CLASS_ENT(CPUType, M68020),
168 CV_ENUM_CLASS_ENT(CPUType, M68030),
169 CV_ENUM_CLASS_ENT(CPUType, M68040),
170 CV_ENUM_CLASS_ENT(CPUType, Alpha),
171 CV_ENUM_CLASS_ENT(CPUType, Alpha21164),
172 CV_ENUM_CLASS_ENT(CPUType, Alpha21164A),
173 CV_ENUM_CLASS_ENT(CPUType, Alpha21264),
174 CV_ENUM_CLASS_ENT(CPUType, Alpha21364),
175 CV_ENUM_CLASS_ENT(CPUType, PPC601),
176 CV_ENUM_CLASS_ENT(CPUType, PPC603),
177 CV_ENUM_CLASS_ENT(CPUType, PPC604),
178 CV_ENUM_CLASS_ENT(CPUType, PPC620),
179 CV_ENUM_CLASS_ENT(CPUType, PPCFP),
180 CV_ENUM_CLASS_ENT(CPUType, PPCBE),
181 CV_ENUM_CLASS_ENT(CPUType, SH3),
182 CV_ENUM_CLASS_ENT(CPUType, SH3E),
183 CV_ENUM_CLASS_ENT(CPUType, SH3DSP),
184 CV_ENUM_CLASS_ENT(CPUType, SH4),
185 CV_ENUM_CLASS_ENT(CPUType, SHMedia),
186 CV_ENUM_CLASS_ENT(CPUType, ARM3),
187 CV_ENUM_CLASS_ENT(CPUType, ARM4),
188 CV_ENUM_CLASS_ENT(CPUType, ARM4T),
189 CV_ENUM_CLASS_ENT(CPUType, ARM5),
190 CV_ENUM_CLASS_ENT(CPUType, ARM5T),
191 CV_ENUM_CLASS_ENT(CPUType, ARM6),
192 CV_ENUM_CLASS_ENT(CPUType, ARM_XMAC),
193 CV_ENUM_CLASS_ENT(CPUType, ARM_WMMX),
194 CV_ENUM_CLASS_ENT(CPUType, ARM7),
195 CV_ENUM_CLASS_ENT(CPUType, Omni),
196 CV_ENUM_CLASS_ENT(CPUType, Ia64),
197 CV_ENUM_CLASS_ENT(CPUType, Ia64_2),
198 CV_ENUM_CLASS_ENT(CPUType, CEE),
199 CV_ENUM_CLASS_ENT(CPUType, AM33),
200 CV_ENUM_CLASS_ENT(CPUType, M32R),
201 CV_ENUM_CLASS_ENT(CPUType, TriCore),
202 CV_ENUM_CLASS_ENT(CPUType, X64),
203 CV_ENUM_CLASS_ENT(CPUType, EBC),
204 CV_ENUM_CLASS_ENT(CPUType, Thumb),
205 CV_ENUM_CLASS_ENT(CPUType, ARMNT),
206 CV_ENUM_CLASS_ENT(CPUType, ARM64),
207 CV_ENUM_CLASS_ENT(CPUType, HybridX86ARM64),
208 CV_ENUM_CLASS_ENT(CPUType, ARM64EC),
209 CV_ENUM_CLASS_ENT(CPUType, ARM64X),
210 CV_ENUM_CLASS_ENT(CPUType, Unknown),
211 CV_ENUM_CLASS_ENT(CPUType, D3D11_Shader),
212};
213
214static const EnumEntry<uint32_t> FrameProcSymFlagNames[] = {
215 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasAlloca),
216 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasSetJmp),
217 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasLongJmp),
218 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasInlineAssembly),
219 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasExceptionHandling),
220 CV_ENUM_CLASS_ENT(FrameProcedureOptions, MarkedInline),
221 CV_ENUM_CLASS_ENT(FrameProcedureOptions, HasStructuredExceptionHandling),
222 CV_ENUM_CLASS_ENT(FrameProcedureOptions, Naked),
223 CV_ENUM_CLASS_ENT(FrameProcedureOptions, SecurityChecks),
224 CV_ENUM_CLASS_ENT(FrameProcedureOptions, AsynchronousExceptionHandling),
225 CV_ENUM_CLASS_ENT(FrameProcedureOptions, NoStackOrderingForSecurityChecks),
226 CV_ENUM_CLASS_ENT(FrameProcedureOptions, Inlined),
227 CV_ENUM_CLASS_ENT(FrameProcedureOptions, StrictSecurityChecks),
228 CV_ENUM_CLASS_ENT(FrameProcedureOptions, SafeBuffers),
229 CV_ENUM_CLASS_ENT(FrameProcedureOptions, EncodedLocalBasePointerMask),
230 CV_ENUM_CLASS_ENT(FrameProcedureOptions, EncodedParamBasePointerMask),
231 CV_ENUM_CLASS_ENT(FrameProcedureOptions, ProfileGuidedOptimization),
232 CV_ENUM_CLASS_ENT(FrameProcedureOptions, ValidProfileCounts),
233 CV_ENUM_CLASS_ENT(FrameProcedureOptions, OptimizedForSpeed),
234 CV_ENUM_CLASS_ENT(FrameProcedureOptions, GuardCfg),
235 CV_ENUM_CLASS_ENT(FrameProcedureOptions, GuardCfw),
236};
237
238static const EnumEntry<uint32_t> ModuleSubstreamKindNames[] = {
239 CV_ENUM_CLASS_ENT(DebugSubsectionKind, None),
240 CV_ENUM_CLASS_ENT(DebugSubsectionKind, Symbols),
241 CV_ENUM_CLASS_ENT(DebugSubsectionKind, Lines),
242 CV_ENUM_CLASS_ENT(DebugSubsectionKind, StringTable),
243 CV_ENUM_CLASS_ENT(DebugSubsectionKind, FileChecksums),
244 CV_ENUM_CLASS_ENT(DebugSubsectionKind, FrameData),
245 CV_ENUM_CLASS_ENT(DebugSubsectionKind, InlineeLines),
246 CV_ENUM_CLASS_ENT(DebugSubsectionKind, CrossScopeImports),
247 CV_ENUM_CLASS_ENT(DebugSubsectionKind, CrossScopeExports),
248 CV_ENUM_CLASS_ENT(DebugSubsectionKind, ILLines),
249 CV_ENUM_CLASS_ENT(DebugSubsectionKind, FuncMDTokenMap),
250 CV_ENUM_CLASS_ENT(DebugSubsectionKind, TypeMDTokenMap),
251 CV_ENUM_CLASS_ENT(DebugSubsectionKind, MergedAssemblyInput),
252 CV_ENUM_CLASS_ENT(DebugSubsectionKind, CoffSymbolRVA),
253};
254
255static const EnumEntry<uint16_t> ExportSymFlagNames[] = {
256 CV_ENUM_CLASS_ENT(ExportFlags, IsConstant),
257 CV_ENUM_CLASS_ENT(ExportFlags, IsData),
258 CV_ENUM_CLASS_ENT(ExportFlags, IsPrivate),
259 CV_ENUM_CLASS_ENT(ExportFlags, HasNoName),
260 CV_ENUM_CLASS_ENT(ExportFlags, HasExplicitOrdinal),
261 CV_ENUM_CLASS_ENT(ExportFlags, IsForwarder),
262};
263
264static const EnumEntry<uint8_t> ThunkOrdinalNames[] = {
265 CV_ENUM_CLASS_ENT(ThunkOrdinal, Standard),
266 CV_ENUM_CLASS_ENT(ThunkOrdinal, ThisAdjustor),
267 CV_ENUM_CLASS_ENT(ThunkOrdinal, Vcall),
268 CV_ENUM_CLASS_ENT(ThunkOrdinal, Pcode),
269 CV_ENUM_CLASS_ENT(ThunkOrdinal, UnknownLoad),
270 CV_ENUM_CLASS_ENT(ThunkOrdinal, TrampIncremental),
271 CV_ENUM_CLASS_ENT(ThunkOrdinal, BranchIsland),
272};
273
274static const EnumEntry<uint16_t> TrampolineNames[] = {
275 CV_ENUM_CLASS_ENT(TrampolineType, TrampIncremental),
276 CV_ENUM_CLASS_ENT(TrampolineType, BranchIsland),
277};
278
279static const EnumEntry<COFF::SectionCharacteristics>
280 ImageSectionCharacteristicNames[] = {
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
318static const EnumEntry<uint16_t> ClassOptionNames[] = {
319 CV_ENUM_CLASS_ENT(ClassOptions, Packed),
320 CV_ENUM_CLASS_ENT(ClassOptions, HasConstructorOrDestructor),
321 CV_ENUM_CLASS_ENT(ClassOptions, HasOverloadedOperator),
322 CV_ENUM_CLASS_ENT(ClassOptions, Nested),
323 CV_ENUM_CLASS_ENT(ClassOptions, ContainsNestedClass),
324 CV_ENUM_CLASS_ENT(ClassOptions, HasOverloadedAssignmentOperator),
325 CV_ENUM_CLASS_ENT(ClassOptions, HasConversionOperator),
326 CV_ENUM_CLASS_ENT(ClassOptions, ForwardReference),
327 CV_ENUM_CLASS_ENT(ClassOptions, Scoped),
328 CV_ENUM_CLASS_ENT(ClassOptions, HasUniqueName),
329 CV_ENUM_CLASS_ENT(ClassOptions, Sealed),
330 CV_ENUM_CLASS_ENT(ClassOptions, Intrinsic),
331};
332
333static const EnumEntry<uint8_t> MemberAccessNames[] = {
334 CV_ENUM_CLASS_ENT(MemberAccess, None),
335 CV_ENUM_CLASS_ENT(MemberAccess, Private),
336 CV_ENUM_CLASS_ENT(MemberAccess, Protected),
337 CV_ENUM_CLASS_ENT(MemberAccess, Public),
338};
339
340static const EnumEntry<uint16_t> MethodOptionNames[] = {
341 CV_ENUM_CLASS_ENT(MethodOptions, Pseudo),
342 CV_ENUM_CLASS_ENT(MethodOptions, NoInherit),
343 CV_ENUM_CLASS_ENT(MethodOptions, NoConstruct),
344 CV_ENUM_CLASS_ENT(MethodOptions, CompilerGenerated),
345 CV_ENUM_CLASS_ENT(MethodOptions, Sealed),
346};
347
348static const EnumEntry<uint16_t> MemberKindNames[] = {
349 CV_ENUM_CLASS_ENT(MethodKind, Vanilla),
350 CV_ENUM_CLASS_ENT(MethodKind, Virtual),
351 CV_ENUM_CLASS_ENT(MethodKind, Static),
352 CV_ENUM_CLASS_ENT(MethodKind, Friend),
353 CV_ENUM_CLASS_ENT(MethodKind, IntroducingVirtual),
354 CV_ENUM_CLASS_ENT(MethodKind, PureVirtual),
355 CV_ENUM_CLASS_ENT(MethodKind, PureIntroducingVirtual),
356};
357
358static const EnumEntry<uint8_t> PtrKindNames[] = {
359 CV_ENUM_CLASS_ENT(PointerKind, Near16),
360 CV_ENUM_CLASS_ENT(PointerKind, Far16),
361 CV_ENUM_CLASS_ENT(PointerKind, Huge16),
362 CV_ENUM_CLASS_ENT(PointerKind, BasedOnSegment),
363 CV_ENUM_CLASS_ENT(PointerKind, BasedOnValue),
364 CV_ENUM_CLASS_ENT(PointerKind, BasedOnSegmentValue),
365 CV_ENUM_CLASS_ENT(PointerKind, BasedOnAddress),
366 CV_ENUM_CLASS_ENT(PointerKind, BasedOnSegmentAddress),
367 CV_ENUM_CLASS_ENT(PointerKind, BasedOnType),
368 CV_ENUM_CLASS_ENT(PointerKind, BasedOnSelf),
369 CV_ENUM_CLASS_ENT(PointerKind, Near32),
370 CV_ENUM_CLASS_ENT(PointerKind, Far32),
371 CV_ENUM_CLASS_ENT(PointerKind, Near64),
372};
373
374static const EnumEntry<uint8_t> PtrModeNames[] = {
375 CV_ENUM_CLASS_ENT(PointerMode, Pointer),
376 CV_ENUM_CLASS_ENT(PointerMode, LValueReference),
377 CV_ENUM_CLASS_ENT(PointerMode, PointerToDataMember),
378 CV_ENUM_CLASS_ENT(PointerMode, PointerToMemberFunction),
379 CV_ENUM_CLASS_ENT(PointerMode, RValueReference),
380};
381
382static const EnumEntry<uint16_t> PtrMemberRepNames[] = {
383 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, Unknown),
384 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, SingleInheritanceData),
385 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, MultipleInheritanceData),
386 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, VirtualInheritanceData),
387 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, GeneralData),
388 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, SingleInheritanceFunction),
389 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation,
390 MultipleInheritanceFunction),
391 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation,
392 VirtualInheritanceFunction),
393 CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, GeneralFunction),
394};
395
396static const EnumEntry<uint16_t> TypeModifierNames[] = {
397 CV_ENUM_CLASS_ENT(ModifierOptions, Const),
398 CV_ENUM_CLASS_ENT(ModifierOptions, Volatile),
399 CV_ENUM_CLASS_ENT(ModifierOptions, Unaligned),
400};
401
402static const EnumEntry<uint8_t> CallingConventions[] = {
403 CV_ENUM_CLASS_ENT(CallingConvention, NearC),
404 CV_ENUM_CLASS_ENT(CallingConvention, FarC),
405 CV_ENUM_CLASS_ENT(CallingConvention, NearPascal),
406 CV_ENUM_CLASS_ENT(CallingConvention, FarPascal),
407 CV_ENUM_CLASS_ENT(CallingConvention, NearFast),
408 CV_ENUM_CLASS_ENT(CallingConvention, FarFast),
409 CV_ENUM_CLASS_ENT(CallingConvention, NearStdCall),
410 CV_ENUM_CLASS_ENT(CallingConvention, FarStdCall),
411 CV_ENUM_CLASS_ENT(CallingConvention, NearSysCall),
412 CV_ENUM_CLASS_ENT(CallingConvention, FarSysCall),
413 CV_ENUM_CLASS_ENT(CallingConvention, ThisCall),
414 CV_ENUM_CLASS_ENT(CallingConvention, MipsCall),
415 CV_ENUM_CLASS_ENT(CallingConvention, Generic),
416 CV_ENUM_CLASS_ENT(CallingConvention, AlphaCall),
417 CV_ENUM_CLASS_ENT(CallingConvention, PpcCall),
418 CV_ENUM_CLASS_ENT(CallingConvention, SHCall),
419 CV_ENUM_CLASS_ENT(CallingConvention, ArmCall),
420 CV_ENUM_CLASS_ENT(CallingConvention, AM33Call),
421 CV_ENUM_CLASS_ENT(CallingConvention, TriCall),
422 CV_ENUM_CLASS_ENT(CallingConvention, SH5Call),
423 CV_ENUM_CLASS_ENT(CallingConvention, M32RCall),
424 CV_ENUM_CLASS_ENT(CallingConvention, ClrCall),
425 CV_ENUM_CLASS_ENT(CallingConvention, Inline),
426 CV_ENUM_CLASS_ENT(CallingConvention, NearVector),
427 CV_ENUM_CLASS_ENT(CallingConvention, Swift),
428};
429
430static const EnumEntry<uint8_t> FunctionOptionEnum[] = {
431 CV_ENUM_CLASS_ENT(FunctionOptions, CxxReturnUdt),
432 CV_ENUM_CLASS_ENT(FunctionOptions, Constructor),
433 CV_ENUM_CLASS_ENT(FunctionOptions, ConstructorWithVirtualBases),
434};
435
436static const EnumEntry<uint16_t> LabelTypeEnum[] = {
437 CV_ENUM_CLASS_ENT(LabelType, Near),
438 CV_ENUM_CLASS_ENT(LabelType, Far),
439};
440
441static const EnumEntry<uint16_t> JumpTableEntrySizeNames[] = {
442 CV_ENUM_CLASS_ENT(JumpTableEntrySize, Int8),
443 CV_ENUM_CLASS_ENT(JumpTableEntrySize, UInt8),
444 CV_ENUM_CLASS_ENT(JumpTableEntrySize, Int16),
445 CV_ENUM_CLASS_ENT(JumpTableEntrySize, UInt16),
446 CV_ENUM_CLASS_ENT(JumpTableEntrySize, Int32),
447 CV_ENUM_CLASS_ENT(JumpTableEntrySize, UInt32),
448 CV_ENUM_CLASS_ENT(JumpTableEntrySize, Pointer),
449 CV_ENUM_CLASS_ENT(JumpTableEntrySize, UInt8ShiftLeft),
450 CV_ENUM_CLASS_ENT(JumpTableEntrySize, UInt16ShiftLeft),
451 CV_ENUM_CLASS_ENT(JumpTableEntrySize, Int8ShiftLeft),
452 CV_ENUM_CLASS_ENT(JumpTableEntrySize, Int16ShiftLeft),
453};
454
455namespace llvm {
456namespace codeview {
457
458ArrayRef<EnumEntry<SymbolKind>> getSymbolTypeNames() {
459 return ArrayRef(SymbolTypeNames);
460}
461
462ArrayRef<EnumEntry<TypeLeafKind>> getTypeLeafNames() {
463 return ArrayRef(TypeLeafNames);
464}
465
466ArrayRef<EnumEntry<uint16_t>> getRegisterNames(CPUType Cpu) {
467 if (Cpu == CPUType::ARMNT) {
468 return ArrayRef(RegisterNames_ARM);
469 } else if (Cpu == CPUType::ARM64) {
470 return ArrayRef(RegisterNames_ARM64);
471 }
472 return ArrayRef(RegisterNames_X86);
473}
474
475ArrayRef<EnumEntry<uint32_t>> getPublicSymFlagNames() {
476 return ArrayRef(PublicSymFlagNames);
477}
478
479ArrayRef<EnumEntry<uint8_t>> getProcSymFlagNames() {
480 return ArrayRef(ProcSymFlagNames);
481}
482
483ArrayRef<EnumEntry<uint16_t>> getLocalFlagNames() {
484 return ArrayRef(LocalFlags);
485}
486
487ArrayRef<EnumEntry<uint8_t>> getFrameCookieKindNames() {
488 return ArrayRef(FrameCookieKinds);
489}
490
491ArrayRef<EnumEntry<SourceLanguage>> getSourceLanguageNames() {
492 return ArrayRef(SourceLanguages);
493}
494
495ArrayRef<EnumEntry<uint32_t>> getCompileSym2FlagNames() {
496 return ArrayRef(CompileSym2FlagNames);
497}
498
499ArrayRef<EnumEntry<uint32_t>> getCompileSym3FlagNames() {
500 return ArrayRef(CompileSym3FlagNames);
501}
502
503ArrayRef<EnumEntry<uint32_t>> getFileChecksumNames() {
504 return ArrayRef(FileChecksumNames);
505}
506
507ArrayRef<EnumEntry<unsigned>> getCPUTypeNames() {
508 return ArrayRef(CPUTypeNames);
509}
510
511ArrayRef<EnumEntry<uint32_t>> getFrameProcSymFlagNames() {
512 return ArrayRef(FrameProcSymFlagNames);
513}
514
515ArrayRef<EnumEntry<uint16_t>> getExportSymFlagNames() {
516 return ArrayRef(ExportSymFlagNames);
517}
518
519ArrayRef<EnumEntry<uint32_t>> getModuleSubstreamKindNames() {
520 return ArrayRef(ModuleSubstreamKindNames);
521}
522
523ArrayRef<EnumEntry<uint8_t>> getThunkOrdinalNames() {
524 return ArrayRef(ThunkOrdinalNames);
525}
526
527ArrayRef<EnumEntry<uint16_t>> getTrampolineNames() {
528 return ArrayRef(TrampolineNames);
529}
530
531ArrayRef<EnumEntry<COFF::SectionCharacteristics>>
532getImageSectionCharacteristicNames() {
533 return ArrayRef(ImageSectionCharacteristicNames);
534}
535
536ArrayRef<EnumEntry<uint16_t>> getClassOptionNames() {
537 return ArrayRef(ClassOptionNames);
538}
539
540ArrayRef<EnumEntry<uint8_t>> getMemberAccessNames() {
541 return ArrayRef(MemberAccessNames);
542}
543
544ArrayRef<EnumEntry<uint16_t>> getMethodOptionNames() {
545 return ArrayRef(MethodOptionNames);
546}
547
548ArrayRef<EnumEntry<uint16_t>> getMemberKindNames() {
549 return ArrayRef(MemberKindNames);
550}
551
552ArrayRef<EnumEntry<uint8_t>> getPtrKindNames() {
553 return ArrayRef(PtrKindNames);
554}
555
556ArrayRef<EnumEntry<uint8_t>> getPtrModeNames() {
557 return ArrayRef(PtrModeNames);
558}
559
560ArrayRef<EnumEntry<uint16_t>> getPtrMemberRepNames() {
561 return ArrayRef(PtrMemberRepNames);
562}
563
564ArrayRef<EnumEntry<uint16_t>> getTypeModifierNames() {
565 return ArrayRef(TypeModifierNames);
566}
567
568ArrayRef<EnumEntry<uint8_t>> getCallingConventions() {
569 return ArrayRef(CallingConventions);
570}
571
572ArrayRef<EnumEntry<uint8_t>> getFunctionOptionEnum() {
573 return ArrayRef(FunctionOptionEnum);
574}
575
576ArrayRef<EnumEntry<uint16_t>> getLabelTypeEnum() {
577 return ArrayRef(LabelTypeEnum);
578}
579
580ArrayRef<EnumEntry<uint16_t>> getJumpTableEntrySizeNames() {
581 return ArrayRef(JumpTableEntrySizeNames);
582}
583
584} // end namespace codeview
585} // end namespace llvm
586