14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H
43 struct LocalVarDefRange {
52 uint16_t IsSubfield : 1;
55 uint16_t StructOffset : 15;
63 bool isDifferentLocation(LocalVarDefRange &O) {
64 return InMemory != O.InMemory || DataOffset != O.DataOffset ||
65 IsSubfield != O.IsSubfield || StructOffset != O.StructOffset ||
66 CVRegister != O.CVRegister;
72 static LocalVarDefRange createDefRangeMem(uint16_t CVRegister,
int Offset);
73 static LocalVarDefRange createDefRangeGeneral(uint16_t CVRegister,
74 bool InMemory,
int Offset,
76 uint16_t StructOffset);
79 struct LocalVariable {
91 unsigned SiteFuncId = 0;
99 std::unordered_map<const DILocation *, InlineSite> InlineSites;
110 unsigned LastFileId = 0;
111 bool HaveLineInfo =
false;
125 void switchToDebugSectionForSymbol(
const MCSymbol *GVSym);
129 unsigned NextFuncId = 0;
131 InlineSite &getInlineSite(
const DILocation *InlinedAt,
137 const FunctionInfo &FI,
138 const InlineSite &Site);
168 unsigned TypeEmissionLevel = 0;
176 std::vector<std::pair<std::string, codeview::TypeIndex>> LocalUDTs,
179 typedef std::map<const DIFile *, std::string> FileToFilepathMapTy;
180 FileToFilepathMapTy FileToFilepathMap;
183 unsigned maybeRecordFile(
const DIFile *
F);
190 CurrentSubprogram = SP;
196 void emitCodeViewMagicVersion();
198 void emitTypeInformation();
200 void emitCompilerInformation();
202 void emitInlineeLinesSubsection();
204 void emitDebugInfoForFunction(
const Function *GV, FunctionInfo &FI);
206 void emitDebugInfoForGlobals();
208 void emitDebugInfoForRetainedTypes();
210 void emitDebugInfoForUDTs(
211 ArrayRef<std::pair<std::string, codeview::TypeIndex>> UDTs);
221 void endCVSubsection(
MCSymbol *EndLabel);
223 void emitInlinedCallSite(
const FunctionInfo &FI,
const DILocation *InlinedAt,
224 const InlineSite &Site);
234 void recordLocalVariable(LocalVariable &&Var,
const DILocation *Loc);
240 void emitLocalVariable(
const LocalVariable &Var);
284 void emitDeferredCompleteTypes();
292 std::tuple<codeview::TypeIndex, codeview::TypeIndex, unsigned, bool>
298 const DIType *ClassTy =
nullptr);
300 unsigned getPointerSizeInBytes();
308 void endModule()
override;
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...
Tagged DWARF-like metadata node.
Holds a subclass of DINode.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
void setSymbolSize(const llvm::MCSymbol *, uint64_t) override
For symbols that have a size designated (e.g.
Streaming machine code generation interface.
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.
Greedy Register Allocator
static const unsigned End
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
Base class for scope-like contexts.
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...
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.
std::pair< const DILocalVariable *, const DILocation * > InlinedVariable
StringRef - Represent a constant reference to a string, i.e.
TypedDINodeRef< DIType > DITypeRef
Basic type, like 'int' or 'float'.