diff options
Diffstat (limited to 'lib/Transforms/Scalar/LICM.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LICM.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 52dd06affe..aa49b24aba 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -508,7 +508,7 @@ void LICM::sink(Instruction &I) { AllocaInst *AI = 0; if (I.getType() != Type::VoidTy) { - AI = new AllocaInst(I.getType(), 0, I.getName(), + AI = new AllocaInst(*Context, I.getType(), 0, I.getName(), I.getParent()->getParent()->getEntryBlock().begin()); CurAST->add(AI); } @@ -853,7 +853,8 @@ void LICM::FindPromotableValuesInLoop( continue; const Type *Ty = cast<PointerType>(V->getType())->getElementType(); - AllocaInst *AI = new AllocaInst(Ty, 0, V->getName()+".tmp", FnStart); + AllocaInst *AI = new AllocaInst(*Context, Ty, 0, + V->getName()+".tmp", FnStart); PromotedValues.push_back(std::make_pair(AI, V)); // Update the AST and alias analysis. |