summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-15 02:10:16 +0000
committerChris Lattner <sabre@nondot.org>2003-09-15 02:10:16 +0000
commite07007c2bd0dcb775ff3eecabb4c31ce8dc5fab0 (patch)
tree10de38ad6b8d88ae6344d7e0998ee256586ce6c0 /lib/Transforms/Utils/InlineFunction.cpp
parent87917610564806bd54d72f8b482ea41785ad0428 (diff)
downloadllvm-e07007c2bd0dcb775ff3eecabb4c31ce8dc5fab0.tar.gz
llvm-e07007c2bd0dcb775ff3eecabb4c31ce8dc5fab0.tar.bz2
llvm-e07007c2bd0dcb775ff3eecabb4c31ce8dc5fab0.tar.xz
Fix bug: Inline/2003-09-14-InlineValue.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8514 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index 17628e2253..9362d26e2b 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/lib/Transforms/Utils/InlineFunction.cpp
@@ -191,10 +191,14 @@ bool InlineFunction(CallSite CS) {
// Next, create the new invoke instruction, inserting it at the end
// of the old basic block.
- new InvokeInst(CI->getCalledValue(), Split, InvokeDest,
- std::vector<Value*>(CI->op_begin()+1, CI->op_end()),
- CI->getName(), BB->getTerminator());
-
+ InvokeInst *II =
+ new InvokeInst(CI->getCalledValue(), Split, InvokeDest,
+ std::vector<Value*>(CI->op_begin()+1, CI->op_end()),
+ CI->getName(), BB->getTerminator());
+
+ // Make sure that anything using the call now uses the invoke!
+ CI->replaceAllUsesWith(II);
+
// Delete the unconditional branch inserted by splitBasicBlock
BB->getInstList().pop_back();
Split->getInstList().pop_front(); // Delete the original call