13 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H 14 #define LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H 35 #include <unordered_map> 49 class MachineFunction;
58 bool EmitDebugGlobalHashes =
false;
64 struct LocalVarDefRange {
84 bool isDifferentLocation(LocalVarDefRange &
O) {
85 return InMemory != O.InMemory || DataOffset != O.DataOffset ||
86 IsSubfield != O.IsSubfield || StructOffset != O.StructOffset ||
87 CVRegister != O.CVRegister;
93 static LocalVarDefRange createDefRangeMem(
uint16_t CVRegister,
int Offset);
96 struct LocalVariable {
99 bool UseReferenceType =
false;
102 struct CVGlobalVariable {
114 unsigned SiteFuncId = 0;
118 struct LexicalBlock {
129 struct FunctionInfo {
130 FunctionInfo() =
default;
133 FunctionInfo(
const FunctionInfo &FI) =
delete;
137 std::unordered_map<const DILocation *, InlineSite> InlineSites;
145 std::unordered_map<const DILexicalBlockBase*, LexicalBlock> LexicalBlocks;
150 std::vector<std::pair<MCSymbol *, MDNode *>>
Annotations;
151 std::vector<std::tuple<const MCSymbol *, const MCSymbol *, const DIType *>>
157 unsigned LastFileId = 0;
160 unsigned FrameSize = 0;
163 unsigned ParamSize = 0;
166 unsigned CSRSize = 0;
169 int OffsetAdjustment = 0;
183 bool HasStackRealignment =
false;
185 bool HaveLineInfo =
false;
187 FunctionInfo *CurFn =
nullptr;
216 void switchToDebugSectionForSymbol(
const MCSymbol *GVSym);
220 unsigned NextFuncId = 0;
222 InlineSite &getInlineSite(
const DILocation *InlinedAt,
227 void calculateRanges(LocalVariable &Var,
231 const FunctionInfo &FI,
232 const InlineSite &Site);
263 unsigned TypeEmissionLevel = 0;
271 std::vector<std::pair<std::string, const DIType *>> LocalUDTs;
272 std::vector<std::pair<std::string, const DIType *>> GlobalUDTs;
274 using FileToFilepathMapTy = std::map<const DIFile *, std::string>;
275 FileToFilepathMapTy FileToFilepathMap;
279 unsigned maybeRecordFile(
const DIFile *
F);
286 CurrentSubprogram = SP;
293 void emitCodeViewMagicVersion();
295 void emitTypeInformation();
297 void emitTypeGlobalHashes();
299 void emitCompilerInformation();
301 void emitBuildInfo();
303 void emitInlineeLinesSubsection();
305 void emitDebugInfoForThunk(
const Function *GV,
309 void emitDebugInfoForFunction(
const Function *GV, FunctionInfo &FI);
311 void emitDebugInfoForRetainedTypes();
314 emitDebugInfoForUDTs(
ArrayRef<std::pair<std::string, const DIType *>> UDTs);
316 void emitDebugInfoForGlobals();
318 void emitDebugInfoForGlobal(
const CVGlobalVariable &CVGV);
324 void endCVSubsection(
MCSymbol *EndLabel);
329 void endSymbolRecord(
MCSymbol *SymEnd);
336 void emitInlinedCallSite(
const FunctionInfo &FI,
const DILocation *InlinedAt,
337 const InlineSite &Site);
341 void collectGlobalVariableInfo();
359 void recordLocalVariable(LocalVariable &&Var,
const LexicalScope *
LS);
362 void emitLocalVariableList(
const FunctionInfo &FI,
366 void emitLocalVariable(
const FunctionInfo &FI,
const LocalVariable &Var);
370 const FunctionInfo& FI);
373 void emitLexicalBlock(
const LexicalBlock &Block,
const FunctionInfo& FI);
378 const DIType *ClassTy =
nullptr);
393 void addToUDTs(
const DIType *Ty);
430 void emitDeferredCompleteTypes();
438 std::tuple<codeview::TypeIndex, codeview::TypeIndex, unsigned, bool>
444 const DIType *ClassTy =
nullptr);
446 unsigned getPointerSizeInBytes();
461 void endModule()
override;
469 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface ...
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
Implements a dense probed hash-table based set.
This class implements a map that also provides access to all stored values in a deterministic order...
LexicalScope - This class is used to track scope information.
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
Tagged DWARF-like metadata node.
void setSymbolSize(const MCSymbol *, uint64_t) override
For symbols that have a size designated (e.g.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Analysis containing CSE Info
Streaming machine code generation interface.
EncodedFramePtrReg
Two-bit value indicating which register is the designated frame pointer register. ...
Allocate memory in an ever growing pool, as if by bump-pointer.
Instrumentation for Order File
This class is intended to be used as a driving class for all asm writers.
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
std::pair< const DINode *, const DILocation * > InlinedEntity
Base class for scope-like contexts.
PointerOptions
Equivalent to misc lfPointerAttr bitfields.
A SetVector that performs no allocations if smaller than a certain size.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn...
Collects and handles line tables information in a CodeView format.
static void clear(coro::Shape &Shape)
Type array for a subprogram.
Representation of each machine instruction.
Base class for debug information backends.
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
StringRef - Represent a constant reference to a string, i.e.
Annotations lets you mark points and ranges inside source code, for tests:
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Basic type, like 'int' or 'float'.