LLVM 22.0.0git
CodeViewYAMLSymbols.cpp
Go to the documentation of this file.
1//===- CodeViewYAMLSymbols.cpp - CodeView YAMLIO Symbol implementation ----===//
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// This file defines classes for handling the YAML representation of CodeView
10// Debug Info.
11//
12//===----------------------------------------------------------------------===//
13
15#include "llvm/ADT/ArrayRef.h"
16#include "llvm/ADT/StringRef.h"
27#include "llvm/Support/Error.h"
30#include <algorithm>
31#include <cstdint>
32#include <cstring>
33#include <optional>
34#include <string>
35#include <vector>
36
37using namespace llvm;
38using namespace llvm::codeview;
39using namespace llvm::CodeViewYAML;
40using namespace llvm::CodeViewYAML::detail;
41using namespace llvm::yaml;
42
45
46// We only need to declare these, the definitions are in CodeViewYAMLTypes.cpp
49
52
65
67
69
71 return ScalarTraits<StringRef>::input(S, V, T.value);
72}
73
74void ScalarTraits<TypeName>::output(const TypeName &T, void *V,
75 raw_ostream &R) {
77}
78
81 auto SymbolNames = getSymbolTypeNames();
82 for (const auto &E : SymbolNames)
83 io.enumCase(Value, E.Name, E.Value);
84}
85
87 CompileSym2Flags &Flags) {
88 auto FlagNames = getCompileSym2FlagNames();
89 for (const auto &E : FlagNames) {
90 io.bitSetCase(Flags, E.Name, static_cast<CompileSym2Flags>(E.Value));
91 }
92}
93
95 CompileSym3Flags &Flags) {
96 auto FlagNames = getCompileSym3FlagNames();
97 for (const auto &E : FlagNames) {
98 io.bitSetCase(Flags, E.Name, static_cast<CompileSym3Flags>(E.Value));
99 }
100}
101
103 auto FlagNames = getExportSymFlagNames();
104 for (const auto &E : FlagNames) {
105 io.bitSetCase(Flags, E.Name, static_cast<ExportFlags>(E.Value));
106 }
107}
108
110 auto FlagNames = getPublicSymFlagNames();
111 for (const auto &E : FlagNames) {
112 io.bitSetCase(Flags, E.Name, static_cast<PublicSymFlags>(E.Value));
113 }
114}
115
117 auto FlagNames = getLocalFlagNames();
118 for (const auto &E : FlagNames) {
119 io.bitSetCase(Flags, E.Name, static_cast<LocalSymFlags>(E.Value));
120 }
121}
122
124 auto FlagNames = getProcSymFlagNames();
125 for (const auto &E : FlagNames) {
126 io.bitSetCase(Flags, E.Name, static_cast<ProcSymFlags>(E.Value));
127 }
128}
129
131 IO &io, FrameProcedureOptions &Flags) {
132 auto FlagNames = getFrameProcSymFlagNames();
133 for (const auto &E : FlagNames) {
134 io.bitSetCase(Flags, E.Name, static_cast<FrameProcedureOptions>(E.Value));
135 }
136}
137
139 auto CpuNames = getCPUTypeNames();
140 for (const auto &E : CpuNames) {
141 io.enumCase(Cpu, E.Name, static_cast<CPUType>(E.Value));
142 }
143}
144
146 const auto *Header = static_cast<COFF::header *>(io.getContext());
147 assert(Header && "The IO context is not initialized");
148
149 std::optional<CPUType> CpuType;
151
152 switch (Header->Machine) {
154 CpuType = CPUType::Pentium3;
155 break;
157 CpuType = CPUType::X64;
158 break;
160 CpuType = CPUType::ARMNT;
161 break;
165 CpuType = CPUType::ARM64;
166 break;
167 }
168
169 if (CpuType)
170 RegNames = getRegisterNames(*CpuType);
171
172 for (const auto &E : RegNames) {
173 io.enumCase(Reg, E.Name, static_cast<RegisterId>(E.Value));
174 }
175 io.enumFallback<Hex16>(Reg);
176}
177
179 IO &io, TrampolineType &Tramp) {
180 auto TrampNames = getTrampolineNames();
181 for (const auto &E : TrampNames) {
182 io.enumCase(Tramp, E.Name, static_cast<TrampolineType>(E.Value));
183 }
184}
185
187 ThunkOrdinal &Ord) {
188 auto ThunkNames = getThunkOrdinalNames();
189 for (const auto &E : ThunkNames) {
190 io.enumCase(Ord, E.Name, static_cast<ThunkOrdinal>(E.Value));
191 }
192}
193
195 IO &io, FrameCookieKind &FC) {
196 auto ThunkNames = getFrameCookieKindNames();
197 for (const auto &E : ThunkNames) {
198 io.enumCase(FC, E.Name, static_cast<FrameCookieKind>(E.Value));
199 }
200}
201
203 IO &io, JumpTableEntrySize &FC) {
204 auto ThunkNames = getJumpTableEntrySizeNames();
205 for (const auto &E : ThunkNames) {
206 io.enumCase(FC, E.Name, static_cast<JumpTableEntrySize>(E.Value));
207 }
208}
209
210namespace llvm {
211namespace yaml {
214 io.mapRequired("OffsetStart", Range.OffsetStart);
215 io.mapRequired("ISectStart", Range.ISectStart);
216 io.mapRequired("Range", Range.Range);
217 }
218};
220 static void mapping(IO &io, LocalVariableAddrGap &Gap) {
221 io.mapRequired("GapStartOffset", Gap.GapStartOffset);
222 io.mapRequired("Range", Gap.Range);
223 }
224};
225} // namespace yaml
226} // namespace llvm
227
228namespace llvm {
229namespace CodeViewYAML {
230namespace detail {
231
234
236 virtual ~SymbolRecordBase() = default;
237
238 virtual void map(yaml::IO &io) = 0;
239 virtual codeview::CVSymbol
241 CodeViewContainer Container) const = 0;
243};
244
245template <typename T> struct SymbolRecordImpl : public SymbolRecordBase {
248
249 void map(yaml::IO &io) override;
250
253 CodeViewContainer Container) const override {
254 return SymbolSerializer::writeOneSymbol(Symbol, Allocator, Container);
255 }
256
260
261 mutable T Symbol;
262};
263
266
267 void map(yaml::IO &io) override;
268
270 CodeViewContainer Container) const override {
271 RecordPrefix Prefix;
272 uint32_t TotalLen = sizeof(RecordPrefix) + Data.size();
273 Prefix.RecordKind = Kind;
274 Prefix.RecordLen = TotalLen - 2;
275 uint8_t *Buffer = Allocator.Allocate<uint8_t>(TotalLen);
276 ::memcpy(Buffer, &Prefix, sizeof(RecordPrefix));
277 ::memcpy(Buffer + sizeof(RecordPrefix), Data.data(), Data.size());
278 return CVSymbol(ArrayRef<uint8_t>(Buffer, TotalLen));
279 }
280
282 this->Kind = CVS.kind();
283 Data = CVS.RecordData.drop_front(sizeof(RecordPrefix));
284 return Error::success();
285 }
286
287 std::vector<uint8_t> Data;
288};
289
291
293 yaml::BinaryRef Binary;
294 if (io.outputting())
295 Binary = yaml::BinaryRef(Data);
296 io.mapRequired("Data", Binary);
297 if (!io.outputting()) {
298 std::string Str;
299 raw_string_ostream OS(Str);
300 Binary.writeAsBinary(OS);
301 Data.assign(Str.begin(), Str.end());
302 }
303}
304
306 IO.mapRequired("Parent", Symbol.Parent);
307 IO.mapRequired("End", Symbol.End);
308 IO.mapRequired("Next", Symbol.Next);
309 IO.mapRequired("Off", Symbol.Offset);
310 IO.mapRequired("Seg", Symbol.Segment);
311 IO.mapRequired("Len", Symbol.Length);
312 IO.mapRequired("Ordinal", Symbol.Thunk);
313}
314
316 IO.mapRequired("Type", Symbol.Type);
317 IO.mapRequired("Size", Symbol.Size);
318 IO.mapRequired("ThunkOff", Symbol.ThunkOffset);
319 IO.mapRequired("TargetOff", Symbol.TargetOffset);
320 IO.mapRequired("ThunkSection", Symbol.ThunkSection);
321 IO.mapRequired("TargetSection", Symbol.TargetSection);
322}
323
325 IO.mapRequired("SectionNumber", Symbol.SectionNumber);
326 IO.mapRequired("Alignment", Symbol.Alignment);
327 IO.mapRequired("Rva", Symbol.Rva);
328 IO.mapRequired("Length", Symbol.Length);
329 IO.mapRequired("Characteristics", Symbol.Characteristics);
330 IO.mapRequired("Name", Symbol.Name);
331}
332
334 IO.mapRequired("Size", Symbol.Size);
335 IO.mapRequired("Characteristics", Symbol.Characteristics);
336 IO.mapRequired("Offset", Symbol.Offset);
337 IO.mapRequired("Segment", Symbol.Segment);
338 IO.mapRequired("Name", Symbol.Name);
339}
340
342 IO.mapRequired("Ordinal", Symbol.Ordinal);
343 IO.mapRequired("Flags", Symbol.Flags);
344 IO.mapRequired("Name", Symbol.Name);
345}
346
348 IO.mapOptional("PtrParent", Symbol.Parent, 0U);
349 IO.mapOptional("PtrEnd", Symbol.End, 0U);
350 IO.mapOptional("PtrNext", Symbol.Next, 0U);
351 IO.mapRequired("CodeSize", Symbol.CodeSize);
352 IO.mapRequired("DbgStart", Symbol.DbgStart);
353 IO.mapRequired("DbgEnd", Symbol.DbgEnd);
354 IO.mapRequired("FunctionType", Symbol.FunctionType);
355 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
356 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
357 IO.mapRequired("Flags", Symbol.Flags);
358 IO.mapRequired("DisplayName", Symbol.Name);
359}
360
362 IO.mapRequired("Type", Symbol.Index);
363 IO.mapRequired("Seg", Symbol.Register);
364 IO.mapRequired("Name", Symbol.Name);
365}
366
368 IO.mapRequired("Flags", Symbol.Flags);
369 IO.mapOptional("Offset", Symbol.Offset, 0U);
370 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
371 IO.mapRequired("Name", Symbol.Name);
372}
373
375 IO.mapRequired("SumName", Symbol.SumName);
376 IO.mapRequired("SymOffset", Symbol.SymOffset);
377 IO.mapRequired("Mod", Symbol.Module);
378 IO.mapRequired("Name", Symbol.Name);
379}
380
382 IO.mapRequired("Entries", Symbol.Fields);
383}
384
386 IO.mapOptional("PtrParent", Symbol.Parent, 0U);
387 IO.mapOptional("PtrEnd", Symbol.End, 0U);
388 IO.mapRequired("Inlinee", Symbol.Inlinee);
389 // TODO: The binary annotations
390}
391
393 IO.mapRequired("Type", Symbol.Type);
394 IO.mapRequired("Flags", Symbol.Flags);
395
396 IO.mapRequired("VarName", Symbol.Name);
397}
398
400 IO.mapRequired("Program", Symbol.Program);
401 IO.mapRequired("Range", Symbol.Range);
402 IO.mapRequired("Gaps", Symbol.Gaps);
403}
404
406 IO.mapRequired("Program", Symbol.Program);
407 IO.mapRequired("OffsetInParent", Symbol.OffsetInParent);
408 IO.mapRequired("Range", Symbol.Range);
409 IO.mapRequired("Gaps", Symbol.Gaps);
410}
411
413 IO.mapRequired("Register", Symbol.Hdr.Register);
414 IO.mapRequired("MayHaveNoName", Symbol.Hdr.MayHaveNoName);
415 IO.mapRequired("Range", Symbol.Range);
416 IO.mapRequired("Gaps", Symbol.Gaps);
417}
418
420 IO.mapRequired("Offset", Symbol.Hdr.Offset);
421 IO.mapRequired("Range", Symbol.Range);
422 IO.mapRequired("Gaps", Symbol.Gaps);
423}
424
426 IO.mapRequired("Register", Symbol.Hdr.Register);
427 IO.mapRequired("MayHaveNoName", Symbol.Hdr.MayHaveNoName);
428 IO.mapRequired("OffsetInParent", Symbol.Hdr.OffsetInParent);
429 IO.mapRequired("Range", Symbol.Range);
430 IO.mapRequired("Gaps", Symbol.Gaps);
431}
432
433template <>
437
439 IO.mapRequired("Register", Symbol.Hdr.Register);
440 IO.mapRequired("Flags", Symbol.Hdr.Flags);
441 IO.mapRequired("BasePointerOffset", Symbol.Hdr.BasePointerOffset);
442 IO.mapRequired("Range", Symbol.Range);
443 IO.mapRequired("Gaps", Symbol.Gaps);
444}
445
447 IO.mapOptional("PtrParent", Symbol.Parent, 0U);
448 IO.mapOptional("PtrEnd", Symbol.End, 0U);
449 IO.mapRequired("CodeSize", Symbol.CodeSize);
450 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
451 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
452 IO.mapRequired("BlockName", Symbol.Name);
453}
454
456 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
457 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
458 IO.mapRequired("Flags", Symbol.Flags);
459 IO.mapRequired("DisplayName", Symbol.Name);
460}
461
463 IO.mapRequired("Signature", Symbol.Signature);
464 IO.mapRequired("ObjectName", Symbol.Name);
465}
466
468 IO.mapRequired("Flags", Symbol.Flags);
469 IO.mapRequired("Machine", Symbol.Machine);
470 IO.mapRequired("FrontendMajor", Symbol.VersionFrontendMajor);
471 IO.mapRequired("FrontendMinor", Symbol.VersionFrontendMinor);
472 IO.mapRequired("FrontendBuild", Symbol.VersionFrontendBuild);
473 IO.mapRequired("BackendMajor", Symbol.VersionBackendMajor);
474 IO.mapRequired("BackendMinor", Symbol.VersionBackendMinor);
475 IO.mapRequired("BackendBuild", Symbol.VersionBackendBuild);
476 IO.mapRequired("Version", Symbol.Version);
477}
478
480 IO.mapRequired("Flags", Symbol.Flags);
481 IO.mapRequired("Machine", Symbol.Machine);
482 IO.mapRequired("FrontendMajor", Symbol.VersionFrontendMajor);
483 IO.mapRequired("FrontendMinor", Symbol.VersionFrontendMinor);
484 IO.mapRequired("FrontendBuild", Symbol.VersionFrontendBuild);
485 IO.mapRequired("FrontendQFE", Symbol.VersionFrontendQFE);
486 IO.mapRequired("BackendMajor", Symbol.VersionBackendMajor);
487 IO.mapRequired("BackendMinor", Symbol.VersionBackendMinor);
488 IO.mapRequired("BackendBuild", Symbol.VersionBackendBuild);
489 IO.mapRequired("BackendQFE", Symbol.VersionBackendQFE);
490 IO.mapRequired("Version", Symbol.Version);
491}
492
494 IO.mapRequired("TotalFrameBytes", Symbol.TotalFrameBytes);
495 IO.mapRequired("PaddingFrameBytes", Symbol.PaddingFrameBytes);
496 IO.mapRequired("OffsetToPadding", Symbol.OffsetToPadding);
497 IO.mapRequired("BytesOfCalleeSavedRegisters",
498 Symbol.BytesOfCalleeSavedRegisters);
499 IO.mapRequired("OffsetOfExceptionHandler", Symbol.OffsetOfExceptionHandler);
500 IO.mapRequired("SectionIdOfExceptionHandler",
501 Symbol.SectionIdOfExceptionHandler);
502 IO.mapRequired("Flags", Symbol.Flags);
503}
504
506 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
507 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
508 IO.mapRequired("Type", Symbol.Type);
509}
510
512 IO.mapRequired("Index", Symbol.Index);
513 IO.mapRequired("ModFilenameOffset", Symbol.ModFilenameOffset);
514 IO.mapRequired("Flags", Symbol.Flags);
515 IO.mapRequired("Name", Symbol.Name);
516}
517
519 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
520 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
521 IO.mapRequired("CallInstructionSize", Symbol.CallInstructionSize);
522 IO.mapRequired("Type", Symbol.Type);
523}
524
526 IO.mapRequired("Register", Symbol.Register);
527 IO.mapRequired("CookieKind", Symbol.CookieKind);
528 IO.mapRequired("Flags", Symbol.Flags);
529}
530
532 IO.mapRequired("FuncID", Symbol.Indices);
533}
534
536 IO.mapRequired("Type", Symbol.Type);
537 IO.mapRequired("UDTName", Symbol.Name);
538}
539
541 IO.mapRequired("BuildId", Symbol.BuildId);
542}
543
545 IO.mapRequired("Offset", Symbol.Offset);
546 IO.mapRequired("Type", Symbol.Type);
547 IO.mapRequired("VarName", Symbol.Name);
548}
549
551 IO.mapRequired("Offset", Symbol.Offset);
552 IO.mapRequired("Type", Symbol.Type);
553 IO.mapRequired("Register", Symbol.Register);
554 IO.mapRequired("VarName", Symbol.Name);
555}
556
558 IO.mapRequired("Type", Symbol.Type);
559 IO.mapRequired("Value", Symbol.Value);
560 IO.mapRequired("Name", Symbol.Name);
561}
562
564 IO.mapRequired("Type", Symbol.Type);
565 IO.mapOptional("Offset", Symbol.DataOffset, 0U);
566 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
567 IO.mapRequired("DisplayName", Symbol.Name);
568}
569
571 IO.mapRequired("Type", Symbol.Type);
572 IO.mapOptional("Offset", Symbol.DataOffset, 0U);
573 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
574 IO.mapRequired("DisplayName", Symbol.Name);
575}
576
578 IO.mapRequired("Namespace", Symbol.Name);
579}
580
582 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
583 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
584 IO.mapRequired("Strings", Symbol.Strings);
585}
586
588 IO.mapRequired("BaseOffset", Symbol.BaseOffset);
589 IO.mapRequired("BaseSegment", Symbol.BaseSegment);
590 IO.mapRequired("SwitchType", Symbol.SwitchType);
591 IO.mapRequired("BranchOffset", Symbol.BranchOffset);
592 IO.mapRequired("TableOffset", Symbol.TableOffset);
593 IO.mapRequired("BranchSegment", Symbol.BranchSegment);
594 IO.mapRequired("TableSegment", Symbol.TableSegment);
595 IO.mapRequired("EntriesCount", Symbol.EntriesCount);
596}
597
599 IO.mapRequired("Function", Symbol.Function);
600 IO.mapRequired("Name", Symbol.Name);
601}
602
603} // end namespace detail
604} // end namespace CodeViewYAML
605} // end namespace llvm
606
608 BumpPtrAllocator &Allocator, CodeViewContainer Container) const {
609 return Symbol->toCodeViewSymbol(Allocator, Container);
610}
611
612namespace llvm {
613namespace yaml {
614
615template <> struct MappingTraits<SymbolRecordBase> {
616 static void mapping(IO &io, SymbolRecordBase &Record) { Record.map(io); }
617};
618
619} // end namespace yaml
620} // end namespace llvm
621
622template <typename SymbolType>
623static inline Expected<CodeViewYAML::SymbolRecord>
626
627 auto Impl = std::make_shared<SymbolType>(Symbol.kind());
628 if (auto EC = Impl->fromCodeViewSymbol(Symbol))
629 return std::move(EC);
630 Result.Symbol = Impl;
631 return Result;
632}
633
634Expected<CodeViewYAML::SymbolRecord>
636#define SYMBOL_RECORD(EnumName, EnumVal, ClassName) \
637 case EnumName: \
638 return fromCodeViewSymbolImpl<SymbolRecordImpl<ClassName>>(Symbol);
639#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName) \
640 SYMBOL_RECORD(EnumName, EnumVal, ClassName)
641 switch (Symbol.kind()) {
642#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
643 default:
645 }
647}
648
649template <typename ConcreteType>
650static void mapSymbolRecordImpl(IO &IO, const char *Class, SymbolKind Kind,
652 if (!IO.outputting())
653 Obj.Symbol = std::make_shared<ConcreteType>(Kind);
654
655 IO.mapRequired(Class, *Obj.Symbol);
656}
657
658void MappingTraits<CodeViewYAML::SymbolRecord>::mapping(
659 IO &IO, CodeViewYAML::SymbolRecord &Obj) {
661 if (IO.outputting())
662 Kind = Obj.Symbol->Kind;
663 IO.mapRequired("Kind", Kind);
664
665#define SYMBOL_RECORD(EnumName, EnumVal, ClassName) \
666 case EnumName: \
667 mapSymbolRecordImpl<SymbolRecordImpl<ClassName>>(IO, #ClassName, Kind, \
668 Obj); \
669 break;
670#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName) \
671 SYMBOL_RECORD(EnumName, EnumVal, ClassName)
672 switch (Kind) {
673#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
674 default:
675 mapSymbolRecordImpl<UnknownSymbolRecord>(IO, "UnknownSym", Kind, Obj);
676 }
677}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the BumpPtrAllocator interface.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static void mapSymbolRecordImpl(IO &IO, const char *Class, SymbolKind Kind, CodeViewYAML::SymbolRecord &Obj)
static Expected< CodeViewYAML::SymbolRecord > fromCodeViewSymbolImpl(CVSymbol Symbol)
Register Reg
#define T
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
#define LLVM_YAML_DECLARE_BITSET_TRAITS(Type)
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
Utility for declaring that a std::vector of a particular type should be considered a YAML sequence.
#define LLVM_YAML_DECLARE_SCALAR_TRAITS(Type, MustQuote)
#define LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(type)
Utility for declaring that a std::vector of a particular type should be considered a YAML flow sequen...
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
YAML I/O does conversion based on types. But often native data types are just a typedef of built in i...
#define LLVM_YAML_DECLARE_ENUM_TRAITS(Type)
An arbitrary precision integer that knows its signedness.
Definition APSInt.h:24
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Definition ArrayRef.h:196
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
static ErrorSuccess success()
Create a success value.
Definition Error.h:336
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
LLVM Value Representation.
Definition Value.h:75
ArrayRef< uint8_t > RecordData
Definition CVRecord.h:60
static Error deserializeAs(CVSymbol Symbol, T &Record)
static CVSymbol writeOneSymbol(SymType &Sym, BumpPtrAllocator &Storage, CodeViewContainer Container)
A 32-bit type reference.
Definition TypeIndex.h:97
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
A raw_ostream that writes to an std::string.
Specialized YAMLIO scalar type for representing a binary blob.
Definition YAML.h:64
void bitSetCase(T &Val, StringRef Str, const T ConstVal)
Definition YAMLTraits.h:759
virtual bool outputting() const =0
void enumCase(T &Val, StringRef Str, const T ConstVal)
Definition YAMLTraits.h:734
void mapOptional(StringRef Key, T &Val)
Definition YAMLTraits.h:799
void * getContext() const
void enumFallback(T &Val)
Definition YAMLTraits.h:748
void mapRequired(StringRef Key, T &Val)
Definition YAMLTraits.h:789
@ IMAGE_FILE_MACHINE_ARM64
Definition COFF.h:101
@ IMAGE_FILE_MACHINE_AMD64
Definition COFF.h:98
@ IMAGE_FILE_MACHINE_ARM64EC
Definition COFF.h:102
@ IMAGE_FILE_MACHINE_I386
Definition COFF.h:105
@ IMAGE_FILE_MACHINE_ARM64X
Definition COFF.h:103
@ IMAGE_FILE_MACHINE_ARMNT
Definition COFF.h:100
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
Definition CodeView.h:416
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Definition CodeView.h:389
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
Definition CodeView.h:430
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< uint32_t > > getCompileSym2FlagNames()
CVRecord< SymbolKind > CVSymbol
Definition CVRecord.h:65
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getExportSymFlagNames()
LLVM_ABI ArrayRef< EnumEntry< uint16_t > > getJumpTableEntrySizeNames()
SymbolRecordKind
Distinguishes individual records in the Symbols subsection of a .debug$S section.
Definition CodeView.h:42
LLVM_ABI ArrayRef< EnumEntry< SymbolKind > > getSymbolTypeNames()
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 > > getProcSymFlagNames()
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition CodeView.h:49
LLVM_ABI ArrayRef< EnumEntry< unsigned > > getCPUTypeNames()
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
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.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
Definition Error.h:340
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:383
LLVM_ABI codeview::CVSymbol toCodeViewSymbol(BumpPtrAllocator &Allocator, codeview::CodeViewContainer Container) const
std::shared_ptr< detail::SymbolRecordBase > Symbol
static LLVM_ABI Expected< SymbolRecord > fromCodeViewSymbol(codeview::CVSymbol Symbol)
virtual codeview::CVSymbol toCodeViewSymbol(BumpPtrAllocator &Allocator, CodeViewContainer Container) const =0
virtual Error fromCodeViewSymbol(codeview::CVSymbol Type)=0
codeview::CVSymbol toCodeViewSymbol(BumpPtrAllocator &Allocator, CodeViewContainer Container) const override
Error fromCodeViewSymbol(codeview::CVSymbol CVS) override
CVSymbol toCodeViewSymbol(BumpPtrAllocator &Allocator, CodeViewContainer Container) const override
static void mapping(IO &io, LocalVariableAddrGap &Gap)
static void mapping(IO &io, LocalVariableAddrRange &Range)
static void mapping(IO &io, SymbolRecordBase &Record)
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
Definition YAMLTraits.h:62
This class should be specialized by any integer type that is a union of bit values and the YAML repre...
Definition YAMLTraits.h:123
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
Definition YAMLTraits.h:107
This class should be specialized by type that requires custom conversion to/from a yaml scalar.
Definition YAMLTraits.h:149