summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-03-09 21:27:52 +0000
committerDevang Patel <dpatel@apple.com>2011-03-09 21:27:52 +0000
commita2ab3999edb7c8c697271636ba1866a6d698f599 (patch)
tree9c912679af0784c79be3e4c47e17c7cfee8e8c3a /lib/Transforms
parent2f26fa48380da12fd8e3d00a7b6baa7ae280870f (diff)
downloadllvm-a2ab3999edb7c8c697271636ba1866a6d698f599.tar.gz
llvm-a2ab3999edb7c8c697271636ba1866a6d698f599.tar.bz2
llvm-a2ab3999edb7c8c697271636ba1866a6d698f599.tar.xz
Preserve line number information while simplifying libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/SimplifyLibCalls.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index 54eaada3e4..6247b0348f 100644
--- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
@@ -1616,6 +1616,9 @@ bool SimplifyLibCalls::runOnFunction(Function &F) {
// Set the builder to the instruction after the call.
Builder.SetInsertPoint(BB, I);
+ // Use debug location of CI for all new instructions.
+ Builder.SetCurrentDebugLocation(CI->getDebugLoc());
+
// Try to optimize this call.
Value *Result = LCO->OptimizeCall(CI, TD, TLI, Builder);
if (Result == 0) continue;