14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_READERS_LVIRREADER_H
15#define LLVM_DEBUGINFO_LOGICALVIEW_READERS_LVIRREADER_H
20#include <unordered_map>
50 Module *TheModule =
nullptr;
58 unsigned DwarfVersion = 0;
64 int64_t DefaultLowerBound = 0;
67 bool UseAllLinkageNames =
true;
71 std::unique_ptr<DbgValueRangeTable> DbgValueRanges;
75 using LVIndexFiles = std::unordered_map<LVScopeCompileUnit *, size_t>;
76 LVIndexFiles IndexFiles;
79 using LVCompileUnitFiles = std::unordered_map<const DIFile *, size_t>;
80 LVCompileUnitFiles CompileUnitFiles;
83 using LVMDObjects = std::unordered_map<const MDNode *, LVElement *>;
84 LVMDObjects MDObjects;
87 LVType *NodeIndexType =
nullptr;
92 bool includeMinimalInlineScopes()
const;
93 bool useAllLinkageNames()
const {
return UseAllLinkageNames; }
95 int64_t getDefaultLowerBound()
const {
return DefaultLowerBound; }
99 static constexpr unsigned OFFSET_INCREASE = 4;
100 void updateLineOffset() {
CurrentOffset += OFFSET_INCREASE; }
105 Iter->second = FileIndex;
110 LVIndexFiles::iterator Iter = IndexFiles.find(
CompileUnit);
111 return Iter != IndexFiles.end() ? Iter->second : 0;
118 size_t getOrCreateSourceID(
const DIFile *File);
121 MDObjects.try_emplace(MD, Element);
124 LVMDObjects::const_iterator Iter = MDObjects.find(MD);
125 return Iter != MDObjects.end() ? Iter->second :
nullptr;
128 return static_cast<LVScope *
>(getElementForSeenMD(MD));
131 return static_cast<LVSymbol *
>(getElementForSeenMD(MD));
134 return static_cast<LVType *
>(getElementForSeenMD(MD));
137 return static_cast<LVLine *
>(getElementForSeenMD(MD));
160 void constructRange(
LVScope *Scope);
180 void addTemplateParams(
LVElement *Element,
const DINodeArray TParams);
194 bool SkipSPAttributes =
false);
197 bool Minimal =
false);
210 bool &GenerateLineBeforePrologue);
222 bool Minimal =
false);
223 void constructSubprogramArguments(
LVScope *
Function,
const DITypeArray Args);
231 void constructTemplateTypeParameter(
LVElement *Element,
233 void constructTemplateValueParameter(
LVElement *Element,
237 return getOrCreateType(
nullptr, Ty);
253 void removeEmptyScopes();
256 void resolveInlinedLexicalScopes();
258 void processLocationGaps();
259 void processScopes();
262 void checkScopes(
LVScope *Scope);
283 return SymbolsWithLocations;
296#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
static Type * getIndexType(Value *In)
static std::string getRegisterName(const TargetRegisterInfo *TRI, Register Reg)
Class for arbitrary precision integers.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM Basic Block Representation.
ConstantFP - Floating Point Values [float, double].
This is the shared class of boolean and integer constants.
A pair of DIGlobalVariable and DIExpression.
An imported module (C++ using directive or similar).
Tagged DWARF-like metadata node.
Base class for scope-like contexts.
Subprogram description. Uses SubclassData1.
Type array for a subprogram.
Base class for variables.
Utility class used to find and store the live debug ranges for variables in a module.
Lightweight error class with error context and mandatory checking.
A Module instance is used to store all the information related to an LLVM module.
A discriminated union of two or more pointer types, with the discriminator in the low bits of the poi...
Utility class used to store the names of SSA values after their owning modules have been destroyed.
Represent a constant reference to a string, i.e.
LLVM Value Representation.
Error createScopes() override
const LVSymbols & GetSymbolsWithLocations() const
void sortScopes() override
LVIRReader(StringRef Filename, StringRef FileFormatName, object::IRObjectFile *Obj, ScopedPrinter &W)
void printAllInstructions(BasicBlock *BB)
LVIRReader & operator=(const LVIRReader &)=delete
LVIRReader(StringRef Filename, StringRef FileFormatName, MemoryBufferRef *Obj, ScopedPrinter &W)
LVIRReader(const LVIRReader &)=delete
std::string FileFormatName
LVScopeCompileUnit * CompileUnit
This class implements an extremely fast bulk output stream that can only output to a stream.
SmallVector< LVSymbol *, 8 > LVSymbols
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
A source language supported by any of the debug info representations.