Add DwarfCompileUnit::getSkeleton that returns DwarfCompileUnit* to avoid having...
authorDavid Blaikie <dblaikie@gmail.com>
Sat, 1 Nov 2014 00:50:34 +0000 (00:50 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sat, 1 Nov 2014 00:50:34 +0000 (00:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221031 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 74c946036c4fcf9da50c8d13d30fc94be05388da..9805fb4874e40fd60dfabd8629327a51cc1f9e06 100644 (file)
@@ -42,6 +42,10 @@ public:
   DwarfCompileUnit(unsigned UID, DICompileUnit Node, AsmPrinter *A,
                    DwarfDebug *DW, DwarfFile *DWU);
 
   DwarfCompileUnit(unsigned UID, DICompileUnit Node, AsmPrinter *A,
                    DwarfDebug *DW, DwarfFile *DWU);
 
+  DwarfCompileUnit *getSkeleton() const {
+    return static_cast<DwarfCompileUnit *>(Skeleton);
+  }
+
   void initStmtList(MCSymbol *DwarfLineSectionSym);
 
   /// Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
   void initStmtList(MCSymbol *DwarfLineSectionSym);
 
   /// Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
index 5af678ea750347137500e658a36be657c49408cb..de5ffeded44711223103f18481c024de41d8c4ef 100644 (file)
@@ -550,8 +550,7 @@ void DwarfDebug::finalizeModuleInfo() {
     if (TheU->getUnitDie().getTag() == dwarf::DW_TAG_compile_unit) {
       // If we're splitting the dwarf out now that we've got the entire
       // CU then add the dwo id to it.
     if (TheU->getUnitDie().getTag() == dwarf::DW_TAG_compile_unit) {
       // If we're splitting the dwarf out now that we've got the entire
       // CU then add the dwo id to it.
-      DwarfCompileUnit *SkCU =
-          static_cast<DwarfCompileUnit *>(TheU->getSkeleton());
+      DwarfCompileUnit *SkCU = TheU->getSkeleton();
       if (useSplitDwarf()) {
         // Emit a unique identifier for this CU.
         uint64_t ID = DIEHash(Asm).computeCUSignature(TheU->getUnitDie());
       if (useSplitDwarf()) {
         // Emit a unique identifier for this CU.
         uint64_t ID = DIEHash(Asm).computeCUSignature(TheU->getUnitDie());
@@ -1580,7 +1579,7 @@ void DwarfDebug::emitDebugPubSection(
     if (Globals.empty())
       continue;
 
     if (Globals.empty())
       continue;
 
-    if (auto Skeleton = static_cast<DwarfCompileUnit *>(TheU->getSkeleton()))
+    if (auto Skeleton = TheU->getSkeleton())
       TheU = Skeleton;
     unsigned ID = TheU->getUniqueID();
 
       TheU = Skeleton;
     unsigned ID = TheU->getUniqueID();