summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h37
1 files changed, 29 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 90f74a3686e..349fee773a1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -15,6 +15,7 @@
#define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
#include "DwarfUnit.h"
+#include "llvm/ADT/SetVector.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/Support/Dwarf.h"
@@ -48,11 +49,10 @@ class DwarfCompileUnit : public DwarfUnit {
/// The start of the unit macro info within macro section.
MCSymbol *MacroLabelBegin;
- typedef llvm::SmallVector<const MDNode *, 8> ImportedEntityList;
- typedef llvm::DenseMap<const MDNode *, ImportedEntityList>
- ImportedEntityMap;
+ typedef llvm::SmallVector<const MDNode *, 8> LocalDeclNodeList;
+ typedef llvm::DenseMap<const MDNode *, LocalDeclNodeList> LocalScopesMap;
- ImportedEntityMap ImportedEntities;
+ LocalScopesMap LocalDeclNodes;
/// GlobalNames - A map of globally visible named entities for this unit.
StringMap<const DIE *> GlobalNames;
@@ -71,6 +71,15 @@ class DwarfCompileUnit : public DwarfUnit {
// ranges/locs.
const MCSymbol *BaseAddress;
+ struct LocalScopeDieInfo {
+ DIE *ConcreteLSDie = nullptr;
+ DIE *AbstractLSDie = nullptr;
+ SetVector<DIE *> InlineLSDies;
+ SetVector<DIE *> LocalDclDies;
+ };
+ // Collection of local scope DIE info.
+ DenseMap<const MDNode *, LocalScopeDieInfo> LocalScopeDieInfoMap;
+
/// \brief Construct a DIE for the given DbgVariable without initializing the
/// DbgVariable's DIE reference.
DIE *constructVariableDIEImpl(const DbgVariable &DV, bool Abstract);
@@ -117,15 +126,14 @@ public:
unsigned getOrCreateSourceID(StringRef FileName, StringRef DirName) override;
- void addImportedEntity(const DIImportedEntity* IE) {
- DIScope *Scope = IE->getScope();
+ void addLocalDeclNode(const DINode *DI, DILocalScope *Scope) {
assert(Scope && "Invalid Scope encoding!");
if (!isa<DILocalScope>(Scope))
// No need to add imported enities that are not local declaration.
return;
auto *LocalScope = cast<DILocalScope>(Scope)->getNonLexicalBlockFileScope();
- ImportedEntities[LocalScope].push_back(IE);
+ LocalDeclNodes[LocalScope].push_back(DI);
}
/// addRange - Add an address range to the list of ranges for this unit.
@@ -173,7 +181,7 @@ public:
/// A helper function to create children of a Scope DIE.
DIE *createScopeChildrenDIE(LexicalScope *Scope,
SmallVectorImpl<DIE *> &Children,
- unsigned *ChildScopeCount = nullptr);
+ bool *HasNonScopeChildren = nullptr);
/// \brief Construct a DIE for this subprogram scope.
void constructSubprogramScopeDIE(LexicalScope *Scope);
@@ -182,11 +190,15 @@ public:
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
+ /// \brief Get or create import_module DIE.
+ DIE *getOrCreateImportedEntityDIE(const DIImportedEntity *Module);
/// \brief Construct import_module DIE.
DIE *constructImportedEntityDIE(const DIImportedEntity *Module);
void finishSubprogramDefinition(const DISubprogram *SP);
+ void finishLocalScopeDefinitions();
+
/// Set the skeleton unit associated with this unit.
void setSkeleton(DwarfCompileUnit &Skel) { Skeleton = &Skel; }
@@ -258,6 +270,15 @@ public:
void setBaseAddress(const MCSymbol *Base) { BaseAddress = Base; }
const MCSymbol *getBaseAddress() const { return BaseAddress; }
+
+ DenseMap<const MDNode *, LocalScopeDieInfo> &getLSDieInfoMap() {
+ return LocalScopeDieInfoMap;
+ }
+
+ /// Add local scope DIE entry to lexical scope info.
+ void addLocalScopeDieToLexicalScope(LexicalScope *LS, DIE *D);
+ /// Add local declaration DIE entry to lexical scope info.
+ void addLocalDclDieToLexicalScope(LexicalScope *LS, DIE *D);
};
} // end llvm namespace
OpenPOWER on IntegriCloud