14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H 15 #define LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H 35 #include <unordered_map> 49 class MachineFunction;
58 bool EmitDebugGlobalHashes =
false;
64 struct LocalVarDefRange {
73 uint16_t IsSubfield : 1;
76 uint16_t StructOffset : 15;
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;
155 unsigned LastFileId = 0;
158 unsigned FrameSize = 0;
161 unsigned ParamSize = 0;
164 unsigned CSRSize = 0;
167 int OffsetAdjustment = 0;
181 bool HasStackRealignment =
false;
183 bool HaveLineInfo =
false;
185 FunctionInfo *CurFn =
nullptr;
214 void switchToDebugSectionForSymbol(
const MCSymbol *GVSym);
218 unsigned NextFuncId = 0;
220 InlineSite &getInlineSite(
const DILocation *InlinedAt,
225 void calculateRanges(LocalVariable &Var,
229 const FunctionInfo &FI,
230 const InlineSite &Site);
261 unsigned TypeEmissionLevel = 0;
269 std::vector<std::pair<std::string, const DIType *>> LocalUDTs;
270 std::vector<std::pair<std::string, const DIType *>> GlobalUDTs;
272 using FileToFilepathMapTy = std::map<const DIFile *, std::string>;
273 FileToFilepathMapTy FileToFilepathMap;
277 unsigned maybeRecordFile(
const DIFile *
F);
284 CurrentSubprogram = SP;
291 void emitCodeViewMagicVersion();
293 void emitTypeInformation();
295 void emitTypeGlobalHashes();
297 void emitCompilerInformation();
299 void emitBuildInfo();
301 void emitInlineeLinesSubsection();
303 void emitDebugInfoForThunk(
const Function *GV,
307 void emitDebugInfoForFunction(
const Function *GV, FunctionInfo &FI);
309 void emitDebugInfoForRetainedTypes();
312 emitDebugInfoForUDTs(
ArrayRef<std::pair<std::string, const DIType *>> UDTs);
314 void emitDebugInfoForGlobals();
323 void endCVSubsection(
MCSymbol *EndLabel);
328 void endSymbolRecord(
MCSymbol *SymEnd);
335 void emitInlinedCallSite(
const FunctionInfo &FI,
const DILocation *InlinedAt,
336 const InlineSite &Site);
340 void collectGlobalVariableInfo();
358 void recordLocalVariable(LocalVariable &&Var,
const LexicalScope *
LS);
361 void emitLocalVariableList(
const FunctionInfo &FI,
365 void emitLocalVariable(
const FunctionInfo &FI,
const LocalVariable &Var);
369 const FunctionInfo& FI);
372 void emitLexicalBlock(
const LexicalBlock &Block,
const FunctionInfo& FI);
392 void addToUDTs(
const DIType *Ty);
429 void emitDeferredCompleteTypes();
437 std::tuple<codeview::TypeIndex, codeview::TypeIndex, unsigned, bool>
443 const DIType *ClassTy =
nullptr);
445 unsigned getPointerSizeInBytes();
460 void endModule()
override;
468 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
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.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Holds a subclass of DINode.
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.
This class is intended to be used as a driving class for all asm writers.
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.
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
StringRef - Represent a constant reference to a string, i.e.
TypedDINodeRef< DIType > DITypeRef
Basic type, like 'int' or 'float'.