Skip to content

Commit

Permalink
Move cross-unit DIE caching to the DwarfFile level, so it doesn't int…
Browse files Browse the repository at this point in the history
…erfere with fission-gmlt data and produce skeleton<>full unit cross referencing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221305 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dwblaikie committed Nov 4, 2014
1 parent c326067 commit 41ebc26
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 0 additions & 12 deletions lib/CodeGen/AsmPrinter/DwarfDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@ class DwarfDebug : public AsmPrinterHandler {
// Maps a CU DIE with its corresponding DwarfCompileUnit.
DenseMap<const DIE *, DwarfCompileUnit *> CUDieMap;

/// Maps MDNodes for type system with the corresponding DIEs. These DIEs can
/// be shared across CUs, that is why we keep the map here instead
/// of in DwarfCompileUnit.
DenseMap<const MDNode *, DIE *> MDTypeNodeToDieMap;

// List of all labels used in aranges generation.
std::vector<SymbolCU> ArangeLabels;

Expand Down Expand Up @@ -497,13 +492,6 @@ class DwarfDebug : public AsmPrinterHandler {

~DwarfDebug() override;

void insertDIE(const MDNode *TypeMD, DIE *Die) {
MDTypeNodeToDieMap.insert(std::make_pair(TypeMD, Die));
}
DIE *getDIE(const MDNode *TypeMD) {
return MDTypeNodeToDieMap.lookup(TypeMD);
}

/// \brief Emit all Dwarf sections that should come prior to the
/// content.
void beginModule();
Expand Down
12 changes: 12 additions & 0 deletions lib/CodeGen/AsmPrinter/DwarfFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ class DwarfFile {
// Collection of abstract subprogram DIEs.
DenseMap<const MDNode *, DIE *> AbstractSPDies;

/// Maps MDNodes for type system with the corresponding DIEs. These DIEs can
/// be shared across CUs, that is why we keep the map here instead
/// of in DwarfCompileUnit.
DenseMap<const MDNode *, DIE *> MDTypeNodeToDieMap;

public:
DwarfFile(AsmPrinter *AP, DwarfDebug &DD, StringRef Pref,
BumpPtrAllocator &DA);
Expand Down Expand Up @@ -100,6 +105,13 @@ class DwarfFile {
DenseMap<const MDNode *, DIE *> &getAbstractSPDies() {
return AbstractSPDies;
}

void insertDIE(const MDNode *TypeMD, DIE *Die) {
MDTypeNodeToDieMap.insert(std::make_pair(TypeMD, Die));
}
DIE *getDIE(const MDNode *TypeMD) {
return MDTypeNodeToDieMap.lookup(TypeMD);
}
};
}
#endif
4 changes: 2 additions & 2 deletions lib/CodeGen/AsmPrinter/DwarfUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static bool isShareableAcrossCUs(DIDescriptor D) {
/// will be kept in DwarfDebug for shareable DIEs.
DIE *DwarfUnit::getDIE(DIDescriptor D) const {
if (isShareableAcrossCUs(D))
return DD->getDIE(D);
return DU->getDIE(D);
return MDNodeToDieMap.lookup(D);
}

Expand All @@ -150,7 +150,7 @@ DIE *DwarfUnit::getDIE(DIDescriptor D) const {
/// will be kept in DwarfDebug for shareable DIEs.
void DwarfUnit::insertDIE(DIDescriptor Desc, DIE *D) {
if (isShareableAcrossCUs(Desc)) {
DD->insertDIE(Desc, D);
DU->insertDIE(Desc, D);
return;
}
MDNodeToDieMap.insert(std::make_pair(Desc, D));
Expand Down

0 comments on commit 41ebc26

Please sign in to comment.