Avoid cast<>, use light weith wrapper directly.
authorDevang Patel <dpatel@apple.com>
Mon, 12 Jan 2009 22:58:14 +0000 (22:58 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 12 Jan 2009 22:58:14 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62115 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfWriter.cpp

index 9f94a2b79efeb9553613f74a2ec92ced96a16946..e7d8a0a305b0c6e8e8b9b682b1d371154d9f8092 100644 (file)
@@ -2629,13 +2629,13 @@ private:
     if (!RootScope) return;
 
     // Get the subprogram debug information entry.
-    DISubprogram *SPD = cast<DISubprogram>(RootScope->getDesc());
+    DISubprogram SPD(RootScope->getDesc()->getGV());
 
     // Get the compile unit context.
-    CompileUnit *Unit = FindCompileUnit(SPD->getCompileUnit());
+    CompileUnit *Unit = FindCompileUnit(SPD.getCompileUnit());
 
     // Get the subprogram die.
-    DIE *SPDie = Unit->getDieMapSlotFor(SPD->getGV());
+    DIE *SPDie = Unit->getDieMapSlotFor(SPD.getGV());
     assert(SPDie && "Missing subprogram descriptor");
 
     // Add the function bounds.