diff options
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp index 5446541550e..78e4d66b398 100644 --- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -825,6 +825,9 @@ bool DeadArgumentEliminationPass::RemoveDeadStuffFromFunction(Function *F) { F->getParent()->getFunctionList().insert(F->getIterator(), NF); NF->takeName(F); + // Patch the pointer to LLVM function in debug info descriptor. + NF->setSubprogram(F->getSubprogram()); + // Loop over all of the callers of the function, transforming the call sites // to pass in a smaller number of arguments into the new function. std::vector<Value*> Args; @@ -1017,9 +1020,6 @@ bool DeadArgumentEliminationPass::RemoveDeadStuffFromFunction(Function *F) { BB.getInstList().erase(RI); } - // Patch the pointer to LLVM function in debug info descriptor. - NF->setSubprogram(F->getSubprogram()); - // Now that the old function is dead, delete it. F->eraseFromParent(); |