aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-12-08 22:26:08 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-12-08 22:26:08 +0000
commit8a954a055339f431409560658159cb50697f46a2 (patch)
tree2bece878462b1ef460f83ced2b2b969f81f30571 /llvm/lib/Transforms/Utils/Local.cpp
parent323e00d9c77144af5becf9168149feada94ba3cc (diff)
downloadllvm-8a954a055339f431409560658159cb50697f46a2.zip
llvm-8a954a055339f431409560658159cb50697f46a2.tar.gz
llvm-8a954a055339f431409560658159cb50697f46a2.tar.bz2
[OperandBundles] Fix a transform in simplifycfg
Reviewers: pcc, majnemer, reames Subscribers: reames, llvm-commits Differential Revision: http://reviews.llvm.org/D15345 llvm-svn: 255062
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index ba79b32..19122dd 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1210,8 +1210,12 @@ static void changeToUnreachable(Instruction *I, bool UseLLVMTrap) {
/// changeToCall - Convert the specified invoke into a normal call.
static void changeToCall(InvokeInst *II) {
- SmallVector<Value*, 8> Args(II->op_begin(), II->op_end() - 3);
- CallInst *NewCall = CallInst::Create(II->getCalledValue(), Args, "", II);
+ CallSite CS(II);
+ SmallVector<Value*, 8> Args(CS.arg_begin(), CS.arg_end());
+ SmallVector<OperandBundleDef, 1> OpBundles;
+ II->getOperandBundlesAsDefs(OpBundles);
+ CallInst *NewCall = CallInst::Create(II->getCalledValue(), Args, OpBundles,
+ "", II);
NewCall->takeName(II);
NewCall->setCallingConv(II->getCallingConv());
NewCall->setAttributes(II->getAttributes());