diff options
-rw-r--r-- | lib/IR/Instructions.cpp | 7 |
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 { |