Push the CURangeList down into the skeleton CU (where available) rather than the...
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 3 Nov 2014 21:52:56 +0000 (21:52 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 3 Nov 2014 21:52:56 +0000 (21:52 +0000)
So that it may be shared between skeleton/full compile unit, for CU
ranges and other ranges to be added for fission+gmlt.

(at some point we might want some kind of object shared between the
skeleton and full compile units for all those things we only want one of
in that scope, rather than having the full unit always look through to
the skeleton... - alternatively, we might be able to have the skeleton
pointer (or another, separate pointer) point to the skeleton or to the
unit itself in non-fission, so we don't have to special case its
absence)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221186 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 714043d0be6912dff7ec9a347f46ef9c104059f4..1bb546e54b2e9ba8a19b4a63e2f018cffc0cbced 100644 (file)
@@ -395,7 +395,7 @@ DwarfCompileUnit::addScopeRangeList(DIE &ScopeDIE,
                             DD->getLabelAfterInsn(R.second)));
 
   // Add the range list to the set of ranges to be emitted.
-  CURangeLists.push_back(std::move(List));
+  (Skeleton ? Skeleton : this)->CURangeLists.push_back(std::move(List));
 }
 
 void DwarfCompileUnit::attachRangesOrLowHighPC(
index 27cfdcdaa4834fd82c6676e425b862d296c286ec..a73cb27c25f45e5e97d66f5edaba0d8e339844fb 100644 (file)
@@ -232,7 +232,7 @@ public:
 
   /// getRangeLists - Get the vector of range lists.
   const SmallVectorImpl<RangeSpanList> &getRangeLists() const {
-    return CURangeLists;
+    return (Skeleton ? Skeleton : this)->CURangeLists;
   }
 
   /// getRanges - Get the list of ranges for this unit.
index 95dedb5549b6efbcb5cd6524ab4881c2a932c225..0da1bb8584b324c332a2fc090d7a5afc8570c814 100644 (file)
@@ -565,7 +565,7 @@ void DwarfDebug::finalizeModuleInfo() {
       if (!AddrPool.isEmpty())
         SkCU->addSectionLabel(SkCU->getUnitDie(), dwarf::DW_AT_GNU_addr_base,
                               DwarfAddrSectionSym, DwarfAddrSectionSym);
-      if (!TheCU.getRangeLists().empty())
+      if (!SkCU->getRangeLists().empty())
         SkCU->addSectionLabel(SkCU->getUnitDie(), dwarf::DW_AT_GNU_ranges_base,
                               DwarfDebugRangeSectionSym,
                               DwarfDebugRangeSectionSym);