mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-03 00:33:09 +00:00
Move cross-unit DIE caching to the DwarfFile level, so it doesn't interfere 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
This commit is contained in:
parent
c326067040
commit
41ebc263a9
@ -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;
|
||||
|
||||
@ -497,13 +492,6 @@ public:
|
||||
|
||||
~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();
|
||||
|
@ -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);
|
||||
@ -100,6 +105,13 @@ public:
|
||||
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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user