diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-11-10 20:13:21 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-11-10 20:13:21 +0000 |
commit | bd1c1bfbd2264a02607b02828e472e1a97e2da12 (patch) | |
tree | f929410869c72e5253cbb4b23276d12facf45b57 /llvm/lib/IR/Instructions.cpp | |
parent | b9ca6dcc6bd65c1d3c636e2e0cabeb56ef975e49 (diff) | |
download | llvm-bd1c1bfbd2264a02607b02828e472e1a97e2da12.zip llvm-bd1c1bfbd2264a02607b02828e472e1a97e2da12.tar.gz llvm-bd1c1bfbd2264a02607b02828e472e1a97e2da12.tar.bz2 |
[IR] Make {Call,Invoke}::cloneImpl aware of operand bundles
This was an omission in the patch that landed initial support for
operand bundles. So far we haven't hit this, but we will once the
inliner is able to inline calls to functions that contain calls with
operand bundles.
llvm-svn: 252645
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index dfd711f..9b6dfc2 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -3989,6 +3989,10 @@ AddrSpaceCastInst *AddrSpaceCastInst::cloneImpl() const { } CallInst *CallInst::cloneImpl() const { + if (hasOperandBundles()) { + unsigned DescriptorBytes = getNumOperandBundles() * sizeof(BundleOpInfo); + return new(getNumOperands(), DescriptorBytes) CallInst(*this); + } return new(getNumOperands()) CallInst(*this); } @@ -4033,6 +4037,10 @@ IndirectBrInst *IndirectBrInst::cloneImpl() const { } InvokeInst *InvokeInst::cloneImpl() const { + if (hasOperandBundles()) { + unsigned DescriptorBytes = getNumOperandBundles() * sizeof(BundleOpInfo); + return new(getNumOperands(), DescriptorBytes) InvokeInst(*this); + } return new(getNumOperands()) InvokeInst(*this); } |