diff options
author | Petar Jovanovic <petar.jovanovic@mips.com> | 2018-02-06 11:11:28 +0000 |
---|---|---|
committer | Petar Jovanovic <petar.jovanovic@mips.com> | 2018-02-06 11:11:28 +0000 |
commit | 714f2413042c1af42269845514e00d2145fcfb50 (patch) | |
tree | 49a13aa94020b0bd512d6b7805ee57b4da2ce9d9 /llvm/lib/Transforms | |
parent | e290a8cd801819850f467f2ab4e3536bcfb5de79 (diff) | |
download | bcm5719-llvm-714f2413042c1af42269845514e00d2145fcfb50.tar.gz bcm5719-llvm-714f2413042c1af42269845514e00d2145fcfb50.zip |
[DeadArgumentElim] Set pointer to DISubprogram before calling RAUW. NFC
It is better to update pointer of the DISuprogram before we call RAUW for
still live arguments of the function, because with the change reviewed in
D42541 in RAUW we compare DISubprograms rather than functions itself.
Patch by Djordje Todorovic.
Differential Revision: https://reviews.llvm.org/D42794
llvm-svn: 324335
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(); |