diff options
Diffstat (limited to 'llvm/lib/Transforms/IPO/ArgumentPromotion.cpp')
| -rw-r--r-- | llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 6 | 
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index dd9f74a881ee..cdf8a2eb598e 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -70,6 +70,7 @@  #include "llvm/IR/Use.h"  #include "llvm/IR/User.h"  #include "llvm/IR/Value.h" +#include "llvm/InitializePasses.h"  #include "llvm/Pass.h"  #include "llvm/Support/Casting.h"  #include "llvm/Support/Debug.h" @@ -386,8 +387,9 @@ doPromotion(Function *F, SmallPtrSetImpl<Argument *> &ArgsToPromote,        // Just add all the struct element types.        Type *AgTy = cast<PointerType>(I->getType())->getElementType(); -      Value *TheAlloca = new AllocaInst(AgTy, DL.getAllocaAddrSpace(), nullptr, -                                        I->getParamAlignment(), "", InsertPt); +      Value *TheAlloca = +          new AllocaInst(AgTy, DL.getAllocaAddrSpace(), nullptr, +                         MaybeAlign(I->getParamAlignment()), "", InsertPt);        StructType *STy = cast<StructType>(AgTy);        Value *Idxs[2] = {ConstantInt::get(Type::getInt32Ty(F->getContext()), 0),                          nullptr};  | 
