summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index 9f94a2b79ef..e7d8a0a305b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -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.
OpenPOWER on IntegriCloud