LLVM 23.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 io.enumFallback<yaml::Hex16>(Value);
85}
86
88 CompileSym2Flags &Flags) {
89 auto FlagNames = getCompileSym2FlagNames();
90 for (const auto &E : FlagNames) {
91 io.bitSetCase(Flags, E.Name, static_cast<CompileSym2Flags>(E.Value));
92 }
93}
94
96 CompileSym3Flags &Flags) {
97 auto FlagNames = getCompileSym3FlagNames();
98 for (const auto &E : FlagNames) {
99 io.bitSetCase(Flags, E.Name, static_cast<CompileSym3Flags>(E.Value));
100 }
101}
102
104 auto FlagNames = getExportSymFlagNames();
105 for (const auto &E : FlagNames) {
106 io.bitSetCase(Flags, E.Name, static_cast<ExportFlags>(E.Value));
107 }
108}
109
111 auto FlagNames = getPublicSymFlagNames();
112 for (const auto &E : FlagNames) {
113 io.bitSetCase(Flags, E.Name, static_cast<PublicSymFlags>(E.Value));
114 }
115}
116
118 auto FlagNames = getLocalFlagNames();
119 for (const auto &E : FlagNames) {
120 io.bitSetCase(Flags, E.Name, static_cast<LocalSymFlags>(E.Value));
121 }
122}
123
125 auto FlagNames = getProcSymFlagNames();
126 for (const auto &E : FlagNames) {
127 io.bitSetCase(Flags, E.Name, static_cast<ProcSymFlags>(E.Value));
128 }
129}
130
132 IO &io, FrameProcedureOptions &Flags) {
133 auto FlagNames = getFrameProcSymFlagNames();
134 for (const auto &E : FlagNames) {
135 io.bitSetCase(Flags, E.Name, static_cast<FrameProcedureOptions>(E.Value));
136 }
137}
138
140 auto CpuNames = getCPUTypeNames();
141 for (const auto &E : CpuNames) {
142 io.enumCase(Cpu, E.Name, static_cast<CPUType>(E.Value));
143 }
144}
145
147 const auto *Header = static_cast<COFF::header *>(io.getContext());
148 assert(Header && "The IO context is not initialized");
149
150 std::optional<CPUType> CpuType;
152
153 switch (Header->Machine) {
155 CpuType = CPUType::Pentium3;
156 break;
158 CpuType = CPUType::X64;
159 break;
161 CpuType = CPUType::ARMNT;
162 break;
166 CpuType = CPUType::ARM64;
167 break;
168 }
169
170 if (CpuType)
171 RegNames = getRegisterNames(*CpuType);
172
173 for (const auto &E : RegNames) {
174 io.enumCase(Reg, E.Name, static_cast<RegisterId>(E.Value));
175 }
176 io.enumFallback<Hex16>(Reg);
177}
178
180 IO &io, TrampolineType &Tramp) {
181 auto TrampNames = getTrampolineNames();
182 for (const auto &E : TrampNames) {
183 io.enumCase(Tramp, E.Name, static_cast<TrampolineType>(E.Value));
184 }
185}
186
188 ThunkOrdinal &Ord) {
189 auto ThunkNames = getThunkOrdinalNames();
190 for (const auto &E : ThunkNames) {
191 io.enumCase(Ord, E.Name, static_cast<ThunkOrdinal>(E.Value));
192 }
193}
194
196 IO &io, FrameCookieKind &FC) {
197 auto ThunkNames = getFrameCookieKindNames();
198 for (const auto &E : ThunkNames) {
199 io.enumCase(FC, E.Name, static_cast<FrameCookieKind>(E.Value));
200 }
201}
202
204 IO &io, JumpTableEntrySize &FC) {
205 auto ThunkNames = getJumpTableEntrySizeNames();
206 for (const auto &E : ThunkNames) {
207 io.enumCase(FC, E.Name, static_cast<JumpTableEntrySize>(E.Value));
208 }
209}
210
211namespace llvm {
212namespace yaml {
215 io.mapRequired("OffsetStart", Range.OffsetStart);
216 io.mapRequired("ISectStart", Range.ISectStart);
217 io.mapRequired("Range", Range.Range);
218 }
219};
221 static void mapping(IO &io, LocalVariableAddrGap &Gap) {
222 io.mapRequired("GapStartOffset", Gap.GapStartOffset);
223 io.mapRequired("Range", Gap.Range);
224 }
225};
226} // namespace yaml
227} // namespace llvm
228
229namespace llvm {
230namespace CodeViewYAML {
231namespace detail {
232
235
237 virtual ~SymbolRecordBase() = default;
238
239 virtual void map(yaml::IO &io) = 0;
240 virtual codeview::CVSymbol
242 CodeViewContainer Container) const = 0;
244};
245
246template <typename T> struct SymbolRecordImpl : public SymbolRecordBase {
249
250 void map(yaml::IO &io) override;
251
254 CodeViewContainer Container) const override {
255 return SymbolSerializer::writeOneSymbol(Symbol, Allocator, Container);
256 }
257
261
262 mutable T Symbol;
263};
264
267
268 void map(yaml::IO &io) override;
269
271 CodeViewContainer Container) const override {
272 RecordPrefix Prefix;
273 uint32_t TotalLen = sizeof(RecordPrefix) + Data.size();
274 Prefix.RecordKind = Kind;
275 Prefix.RecordLen = TotalLen - 2;
276 uint8_t *Buffer = Allocator.Allocate<uint8_t>(TotalLen);
277 ::memcpy(Buffer, &Prefix, sizeof(RecordPrefix));
278 ::memcpy(Buffer + sizeof(RecordPrefix), Data.data(), Data.size());
279 return CVSymbol(ArrayRef<uint8_t>(Buffer, TotalLen));
280 }
281
283 this->Kind = CVS.kind();
284 Data = CVS.RecordData.drop_front(sizeof(RecordPrefix));
285 return Error::success();
286 }
287
288 std::vector<uint8_t> Data;
289};
290
292
294 yaml::BinaryRef Binary;
295 if (io.outputting())
296 Binary = yaml::BinaryRef(Data);
297 io.mapRequired("Data", Binary);
298 if (!io.outputting()) {
299 std::string Str;
300 raw_string_ostream OS(Str);
301 Binary.writeAsBinary(OS);
302 Data.assign(Str.begin(), Str.end());
303 }
304}
305
307 IO.mapRequired("Parent", Symbol.Parent);
308 IO.mapRequired("End", Symbol.End);
309 IO.mapRequired("Next", Symbol.Next);
310 IO.mapRequired("Off", Symbol.Offset);
311 IO.mapRequired("Seg", Symbol.Segment);
312 IO.mapRequired("Len", Symbol.Length);
313 IO.mapRequired("Ordinal", Symbol.Thunk);
314}
315
317 IO.mapRequired("Type", Symbol.Type);
318 IO.mapRequired("Size", Symbol.Size);
319 IO.mapRequired("ThunkOff", Symbol.ThunkOffset);
320 IO.mapRequired("TargetOff", Symbol.TargetOffset);
321 IO.mapRequired("ThunkSection", Symbol.ThunkSection);
322 IO.mapRequired("TargetSection", Symbol.TargetSection);
323}
324
326 IO.mapRequired("SectionNumber", Symbol.SectionNumber);
327 IO.mapRequired("Alignment", Symbol.Alignment);
328 IO.mapRequired("Rva", Symbol.Rva);
329 IO.mapRequired("Length", Symbol.Length);
330 IO.mapRequired("Characteristics", Symbol.Characteristics);
331 IO.mapRequired("Name", Symbol.Name);
332}
333
335 IO.mapRequired("Size", Symbol.Size);
336 IO.mapRequired("Characteristics", Symbol.Characteristics);
337 IO.mapRequired("Offset", Symbol.Offset);
338 IO.mapRequired("Segment", Symbol.Segment);
339 IO.mapRequired("Name", Symbol.Name);
340}
341
343 IO.mapRequired("Ordinal", Symbol.Ordinal);
344 IO.mapRequired("Flags", Symbol.Flags);
345 IO.mapRequired("Name", Symbol.Name);
346}
347
349 IO.mapOptional("PtrParent", Symbol.Parent, 0U);
350 IO.mapOptional("PtrEnd", Symbol.End, 0U);
351 IO.mapOptional("PtrNext", Symbol.Next, 0U);
352 IO.mapRequired("CodeSize", Symbol.CodeSize);
353 IO.mapRequired("DbgStart", Symbol.DbgStart);
354 IO.mapRequired("DbgEnd", Symbol.DbgEnd);
355 IO.mapRequired("FunctionType", Symbol.FunctionType);
356 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
357 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
358 IO.mapRequired("Flags", Symbol.Flags);
359 IO.mapRequired("DisplayName", Symbol.Name);
360}
361
363 IO.mapRequired("Type", Symbol.Index);
364 IO.mapRequired("Seg", Symbol.Register);
365 IO.mapRequired("Name", Symbol.Name);
366}
367
369 IO.mapRequired("Flags", Symbol.Flags);
370 IO.mapOptional("Offset", Symbol.Offset, 0U);
371 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
372 IO.mapRequired("Name", Symbol.Name);
373}
374
376 IO.mapRequired("SumName", Symbol.SumName);
377 IO.mapRequired("SymOffset", Symbol.SymOffset);
378 IO.mapRequired("Mod", Symbol.Module);
379 IO.mapRequired("Name", Symbol.Name);
380}
381
383 IO.mapRequired("Entries", Symbol.Fields);
384}
385
387 IO.mapOptional("PtrParent", Symbol.Parent, 0U);
388 IO.mapOptional("PtrEnd", Symbol.End, 0U);
389 IO.mapRequired("Inlinee", Symbol.Inlinee);
390 IO.mapOptional("AnnotationData", Symbol.AnnotationData);
391}
392
394 IO.mapRequired("Type", Symbol.Type);
395 IO.mapRequired("Flags", Symbol.Flags);
396
397 IO.mapRequired("VarName", Symbol.Name);
398}
399
401 IO.mapRequired("Program", Symbol.Program);
402 IO.mapRequired("Range", Symbol.Range);
403 IO.mapRequired("Gaps", Symbol.Gaps);
404}
405
407 IO.mapRequired("Program", Symbol.Program);
408 IO.mapRequired("OffsetInParent", Symbol.OffsetInParent);
409 IO.mapRequired("Range", Symbol.Range);
410 IO.mapRequired("Gaps", Symbol.Gaps);
411}
412
414 IO.mapRequired("Register", Symbol.Hdr.Register);
415 IO.mapRequired("MayHaveNoName", Symbol.Hdr.MayHaveNoName);
416 IO.mapRequired("Range", Symbol.Range);
417 IO.mapRequired("Gaps", Symbol.Gaps);
418}
419
421 IO.mapRequired("Offset", Symbol.Hdr.Offset);
422 IO.mapRequired("Range", Symbol.Range);
423 IO.mapRequired("Gaps", Symbol.Gaps);
424}
425
427 IO.mapRequired("Register", Symbol.Hdr.Register);
428 IO.mapRequired("MayHaveNoName", Symbol.Hdr.MayHaveNoName);
429 IO.mapRequired("OffsetInParent", Symbol.Hdr.OffsetInParent);
430 IO.mapRequired("Range", Symbol.Range);
431 IO.mapRequired("Gaps", Symbol.Gaps);
432}
433
434template <>
438
440 IO.mapRequired("Register", Symbol.Hdr.Register);
441 IO.mapRequired("Flags", Symbol.Hdr.Flags);
442 IO.mapRequired("BasePointerOffset", Symbol.Hdr.BasePointerOffset);
443 IO.mapRequired("Range", Symbol.Range);
444 IO.mapRequired("Gaps", Symbol.Gaps);
445}
446
448 IO.mapOptional("PtrParent", Symbol.Parent, 0U);
449 IO.mapOptional("PtrEnd", Symbol.End, 0U);
450 IO.mapRequired("CodeSize", Symbol.CodeSize);
451 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
452 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
453 IO.mapRequired("BlockName", Symbol.Name);
454}
455
457 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
458 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
459 IO.mapRequired("Flags", Symbol.Flags);
460 IO.mapRequired("DisplayName", Symbol.Name);
461}
462
464 IO.mapRequired("Signature", Symbol.Signature);
465 IO.mapRequired("ObjectName", Symbol.Name);
466}
467
469 IO.mapRequired("Flags", Symbol.Flags);
470 IO.mapRequired("Machine", Symbol.Machine);
471 IO.mapRequired("FrontendMajor", Symbol.VersionFrontendMajor);
472 IO.mapRequired("FrontendMinor", Symbol.VersionFrontendMinor);
473 IO.mapRequired("FrontendBuild", Symbol.VersionFrontendBuild);
474 IO.mapRequired("BackendMajor", Symbol.VersionBackendMajor);
475 IO.mapRequired("BackendMinor", Symbol.VersionBackendMinor);
476 IO.mapRequired("BackendBuild", Symbol.VersionBackendBuild);
477 IO.mapRequired("Version", Symbol.Version);
478}
479
481 IO.mapRequired("Flags", Symbol.Flags);
482 IO.mapRequired("Machine", Symbol.Machine);
483 IO.mapRequired("FrontendMajor", Symbol.VersionFrontendMajor);
484 IO.mapRequired("FrontendMinor", Symbol.VersionFrontendMinor);
485 IO.mapRequired("FrontendBuild", Symbol.VersionFrontendBuild);
486 IO.mapRequired("FrontendQFE", Symbol.VersionFrontendQFE);
487 IO.mapRequired("BackendMajor", Symbol.VersionBackendMajor);
488 IO.mapRequired("BackendMinor", Symbol.VersionBackendMinor);
489 IO.mapRequired("BackendBuild", Symbol.VersionBackendBuild);
490 IO.mapRequired("BackendQFE", Symbol.VersionBackendQFE);
491 IO.mapRequired("Version", Symbol.Version);
492}
493
495 IO.mapRequired("TotalFrameBytes", Symbol.TotalFrameBytes);
496 IO.mapRequired("PaddingFrameBytes", Symbol.PaddingFrameBytes);
497 IO.mapRequired("OffsetToPadding", Symbol.OffsetToPadding);
498 IO.mapRequired("BytesOfCalleeSavedRegisters",
499 Symbol.BytesOfCalleeSavedRegisters);
500 IO.mapRequired("OffsetOfExceptionHandler", Symbol.OffsetOfExceptionHandler);
501 IO.mapRequired("SectionIdOfExceptionHandler",
502 Symbol.SectionIdOfExceptionHandler);
503 IO.mapRequired("Flags", Symbol.Flags);
504}
505
507 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
508 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
509 IO.mapRequired("Type", Symbol.Type);
510}
511
513 IO.mapRequired("Index", Symbol.Index);
514 IO.mapRequired("ModFilenameOffset", Symbol.ModFilenameOffset);
515 IO.mapRequired("Flags", Symbol.Flags);
516 IO.mapRequired("Name", Symbol.Name);
517}
518
520 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
521 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
522 IO.mapRequired("CallInstructionSize", Symbol.CallInstructionSize);
523 IO.mapRequired("Type", Symbol.Type);
524}
525
527 IO.mapRequired("Register", Symbol.Register);
528 IO.mapRequired("CookieKind", Symbol.CookieKind);
529 IO.mapRequired("Flags", Symbol.Flags);
530}
531
533 IO.mapRequired("FuncID", Symbol.Indices);
534}
535
537 IO.mapRequired("Type", Symbol.Type);
538 IO.mapRequired("UDTName", Symbol.Name);
539}
540
542 IO.mapRequired("BuildId", Symbol.BuildId);
543}
544
546 IO.mapRequired("Offset", Symbol.Offset);
547 IO.mapRequired("Type", Symbol.Type);
548 IO.mapRequired("VarName", Symbol.Name);
549}
550
552 IO.mapRequired("Offset", Symbol.Offset);
553 IO.mapRequired("Type", Symbol.Type);
554 IO.mapRequired("Register", Symbol.Register);
555 IO.mapRequired("VarName", Symbol.Name);
556}
557
559 IO.mapRequired("Type", Symbol.Type);
560 IO.mapRequired("Value", Symbol.Value);
561 IO.mapRequired("Name", Symbol.Name);
562}
563
565 IO.mapRequired("Type", Symbol.Type);
566 IO.mapOptional("Offset", Symbol.DataOffset, 0U);
567 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
568 IO.mapRequired("DisplayName", Symbol.Name);
569}
570
572 IO.mapRequired("Type", Symbol.Type);
573 IO.mapOptional("Offset", Symbol.DataOffset, 0U);
574 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
575 IO.mapRequired("DisplayName", Symbol.Name);
576}
577
579 IO.mapRequired("Namespace", Symbol.Name);
580}
581
583 IO.mapOptional("Offset", Symbol.CodeOffset, 0U);
584 IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
585 IO.mapRequired("Strings", Symbol.Strings);
586}
587
589 IO.mapRequired("BaseOffset", Symbol.BaseOffset);
590 IO.mapRequired("BaseSegment", Symbol.BaseSegment);
591 IO.mapRequired("SwitchType", Symbol.SwitchType);
592 IO.mapRequired("BranchOffset", Symbol.BranchOffset);
593 IO.mapRequired("TableOffset", Symbol.TableOffset);
594 IO.mapRequired("BranchSegment", Symbol.BranchSegment);
595 IO.mapRequired("TableSegment", Symbol.TableSegment);
596 IO.mapRequired("EntriesCount", Symbol.EntriesCount);
597}
598
600 IO.mapRequired("Function", Symbol.Function);
601 IO.mapRequired("Name", Symbol.Name);
602}
603
604} // end namespace detail
605} // end namespace CodeViewYAML
606} // end namespace llvm
607
609 BumpPtrAllocator &Allocator, CodeViewContainer Container) const {
610 return Symbol->toCodeViewSymbol(Allocator, Container);
611}
612
613namespace llvm {
614namespace yaml {
615
616template <> struct MappingTraits<SymbolRecordBase> {
617 static void mapping(IO &io, SymbolRecordBase &Record) { Record.map(io); }
618};
619
620} // end namespace yaml
621} // end namespace llvm
622
623template <typename SymbolType>
624static inline Expected<CodeViewYAML::SymbolRecord>
627
628 auto Impl = std::make_shared<SymbolType>(Symbol.kind());
629 if (auto EC = Impl->fromCodeViewSymbol(Symbol))
630 return std::move(EC);
631 Result.Symbol = std::move(Impl);
632 return Result;
633}
634
635Expected<CodeViewYAML::SymbolRecord>
637#define SYMBOL_RECORD(EnumName, EnumVal, ClassName) \
638 case EnumName: \
639 return fromCodeViewSymbolImpl<SymbolRecordImpl<ClassName>>(Symbol);
640#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName) \
641 SYMBOL_RECORD(EnumName, EnumVal, ClassName)
642 switch (Symbol.kind()) {
643#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
644 default:
646 }
648}
649
650template <typename ConcreteType>
651static void mapSymbolRecordImpl(IO &IO, const char *Class, SymbolKind Kind,
653 if (!IO.outputting())
654 Obj.Symbol = std::make_shared<ConcreteType>(Kind);
655
656 IO.mapRequired(Class, *Obj.Symbol);
657}
658
659void MappingTraits<CodeViewYAML::SymbolRecord>::mapping(
660 IO &IO, CodeViewYAML::SymbolRecord &Obj) {
662 if (IO.outputting())
663 Kind = Obj.Symbol->Kind;
664 IO.mapRequired("Kind", Kind);
665
666#define SYMBOL_RECORD(EnumName, EnumVal, ClassName) \
667 case EnumName: \
668 mapSymbolRecordImpl<SymbolRecordImpl<ClassName>>(IO, #ClassName, Kind, \
669 Obj); \
670 break;
671#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName) \
672 SYMBOL_RECORD(EnumName, EnumVal, ClassName)
673 switch (Kind) {
674#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
675 default:
676 mapSymbolRecordImpl<UnknownSymbolRecord>(IO, "UnknownSym", Kind, Obj);
677 }
678}
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:40
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Definition ArrayRef.h:195
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:415
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Definition CodeView.h:388
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
Definition CodeView.h:429
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
Definition CodeView.h:76
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
Definition CodeView.h:445
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:41
LLVM_ABI ArrayRef< EnumEntry< SymbolKind > > getSymbolTypeNames()
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition CodeView.h:536
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:48
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:405
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.
Definition Types.h:26
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