summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-04-30 16:12:21 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-04-30 16:12:21 +0000
commitc16fa8872080f5beb927e6c68b5ada50cbc9dc24 (patch)
tree734f6615df84235dc48a346ebf17467f9b9b7074 /lib
parentc3a5ef59e48a5fea5358cc6097d6cd2f99f61844 (diff)
downloadllvm-c16fa8872080f5beb927e6c68b5ada50cbc9dc24.tar.gz
llvm-c16fa8872080f5beb927e6c68b5ada50cbc9dc24.tar.bz2
llvm-c16fa8872080f5beb927e6c68b5ada50cbc9dc24.tar.xz
IR: Alloca clones should remember inalloca state
Pretty straightforward, we weren't propagating whether or not an AllocaInst had 'inalloca' marked on it when it came time to clone it. The inliner exposed this bug. A reduced testcase is forthcoming. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/Instructions.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp
index 5b93c5323a..e8bcddbd99 100644
--- a/lib/IR/Instructions.cpp
+++ b/lib/IR/Instructions.cpp
@@ -3587,9 +3587,10 @@ InsertValueInst *InsertValueInst::clone_impl() const {
}
AllocaInst *AllocaInst::clone_impl() const {
- return new AllocaInst(getAllocatedType(),
- (Value*)getOperand(0),
- getAlignment());
+ AllocaInst *Result = new AllocaInst(getAllocatedType(),
+ (Value *)getOperand(0), getAlignment());
+ Result->setUsedWithInAlloca(isUsedWithInAlloca());
+ return Result;
}
LoadInst *LoadInst::clone_impl() const {