[llvm-commits] [llvm] r130419 - /llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp
Devang Patel
dpatel at apple.com
Thu Apr 28 11:43:39 PDT 2011
Author: dpatel
Date: Thu Apr 28 13:43:39 2011
New Revision: 130419
URL: http://llvm.org/viewvc/llvm-project?rev=130419&view=rev
Log:
Do not lose line number info while eliminating tail call.
Modified:
llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=130419&r1=130418&r2=130419&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Thu Apr 28 13:43:39 2011
@@ -573,7 +573,9 @@
// Now that all of the PHI nodes are in place, remove the call and
// ret instructions, replacing them with an unconditional branch.
- BranchInst::Create(OldEntry, Ret);
+ BranchInst *NewBI = BranchInst::Create(OldEntry, Ret);
+ NewBI->setDebugLoc(CI->getDebugLoc());
+
BB->getInstList().erase(Ret); // Remove return.
BB->getInstList().erase(CI); // Remove call.
++NumEliminated;
More information about the llvm-commits
mailing list