From 41ebc263a98a8ba1e0f2f644d8204b5ffd1cbfa6 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 4 Nov 2014 22:12:18 +0000 Subject: [PATCH] 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 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 12 ------------ lib/CodeGen/AsmPrinter/DwarfFile.h | 12 ++++++++++++ lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index fcd70c43c45..48c280911f4 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -173,11 +173,6 @@ class DwarfDebug : public AsmPrinterHandler { // Maps a CU DIE with its corresponding DwarfCompileUnit. DenseMap 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 MDTypeNodeToDieMap; - // List of all labels used in aranges generation. std::vector 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(); diff --git a/lib/CodeGen/AsmPrinter/DwarfFile.h b/lib/CodeGen/AsmPrinter/DwarfFile.h index 40454cec3f4..9d64bfcdb9c 100644 --- a/lib/CodeGen/AsmPrinter/DwarfFile.h +++ b/lib/CodeGen/AsmPrinter/DwarfFile.h @@ -57,6 +57,11 @@ class DwarfFile { // Collection of abstract subprogram DIEs. DenseMap 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 MDTypeNodeToDieMap; + public: DwarfFile(AsmPrinter *AP, DwarfDebug &DD, StringRef Pref, BumpPtrAllocator &DA); @@ -100,6 +105,13 @@ public: DenseMap &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 diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 1730b9b62ea..1793757afcf 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -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)); -- 2.11.0