82 for (
const auto &
E : SymbolNames)
89 for (
const auto &
E : FlagNames) {
98 for (
const auto &
E : FlagNames) {
106 for (
const auto &
E : FlagNames) {
114 for (
const auto &
E : FlagNames) {
122 for (
const auto &
E : FlagNames) {
130 for (
const auto &
E : FlagNames) {
139 for (
const auto &
E : FlagNames) {
147 for (
const auto &
E : CpuNames) {
154 assert(Header &&
"The IO context is not initialized");
156 std::optional<CPUType> CpuType;
159 switch (Header->Machine) {
179 for (
const auto &
E : RegNames) {
188 for (
const auto &
E : TrampNames) {
197 for (
const auto &
E : ThunkNames) {
205 for (
const auto &
E : ThunkNames) {
214 for (
const auto &
E : ThunkNames) {
283 Prefix.RecordKind =
Kind;
284 Prefix.RecordLen = TotalLen - 2;
310 Binary.writeAsBinary(OS);
311 Data.assign(Str.begin(), Str.end());
508 Symbol.BytesOfCalleeSavedRegisters);
511 Symbol.SectionIdOfExceptionHandler);
619 return Symbol->toCodeViewSymbol(Allocator, Container);
632template <
typename SymbolType>
633static inline Expected<CodeViewYAML::SymbolRecord>
637 auto Impl = std::make_shared<SymbolType>(Symbol.kind());
638 if (
auto EC = Impl->fromCodeViewSymbol(Symbol))
639 return std::move(
EC);
640 Result.Symbol = Impl;
644Expected<CodeViewYAML::SymbolRecord>
646#define SYMBOL_RECORD(EnumName, EnumVal, ClassName) \
648 return fromCodeViewSymbolImpl<SymbolRecordImpl<ClassName>>(Symbol);
649#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName) \
650 SYMBOL_RECORD(EnumName, EnumVal, ClassName)
652#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
659template <
typename ConcreteType>
663 Obj.
Symbol = std::make_shared<ConcreteType>(Kind);
668void MappingTraits<CodeViewYAML::SymbolRecord>::mapping(
669 IO &IO, CodeViewYAML::SymbolRecord &Obj) {
675#define SYMBOL_RECORD(EnumName, EnumVal, ClassName) \
677 mapSymbolRecordImpl<SymbolRecordImpl<ClassName>>(IO, #ClassName, Kind, \
680#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName) \
681 SYMBOL_RECORD(EnumName, EnumVal, ClassName)
683#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
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)
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.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
ArrayRef< uint8_t > RecordData
static Error deserializeAs(CVSymbol Symbol, T &Record)
static CVSymbol writeOneSymbol(SymType &Sym, BumpPtrAllocator &Storage, CodeViewContainer Container)
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
Specialized YAMLIO scalar type for representing a binary blob.
void mapOptional(const char *Key, T &Val)
void bitSetCase(T &Val, const char *Str, const T ConstVal)
virtual bool outputting() const =0
void mapRequired(const char *Key, T &Val)
void * getContext() const
void enumFallback(T &Val)
void enumCase(T &Val, const char *Str, const T ConstVal)
@ IMAGE_FILE_MACHINE_ARM64
@ IMAGE_FILE_MACHINE_AMD64
@ IMAGE_FILE_MACHINE_ARM64EC
@ IMAGE_FILE_MACHINE_I386
@ IMAGE_FILE_MACHINE_ARM64X
@ IMAGE_FILE_MACHINE_ARMNT
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
LLVM_ABI ArrayRef< EnumEntry< uint32_t > > getCompileSym2FlagNames()
CVRecord< SymbolKind > CVSymbol
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.
LLVM_ABI ArrayRef< EnumEntry< SymbolKind > > getSymbolTypeNames()
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
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.
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.
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.
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
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)
SymbolRecordBase(codeview::SymbolKind K)
codeview::SymbolKind Kind
virtual void map(yaml::IO &io)=0
virtual codeview::CVSymbol toCodeViewSymbol(BumpPtrAllocator &Allocator, CodeViewContainer Container) const =0
virtual ~SymbolRecordBase()=default
virtual Error fromCodeViewSymbol(codeview::CVSymbol Type)=0
codeview::CVSymbol toCodeViewSymbol(BumpPtrAllocator &Allocator, CodeViewContainer Container) const override
void map(yaml::IO &io) override
Error fromCodeViewSymbol(codeview::CVSymbol CVS) override
SymbolRecordImpl(codeview::SymbolKind K)
std::vector< uint8_t > Data
Error fromCodeViewSymbol(CVSymbol CVS) override
void map(yaml::IO &io) override
UnknownSymbolRecord(codeview::SymbolKind K)
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.
This class should be specialized by any integer type that is a union of bit values and the YAML repre...
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
This class should be specialized by type that requires custom conversion to/from a yaml scalar.