diff options
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 4d90cbc84a..6ab227d95a 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -219,8 +219,9 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) { const llvm::Type *LTy = ConvertType(Ty); if (LTy->isSingleValueType()) { // TODO: Alignment - DeclPtr = new llvm::AllocaInst(LTy, 0, std::string(D.getName())+".addr", - AllocaInsertPt); + std::string Name(D.getName()); + Name += ".addr"; + DeclPtr = CreateTempAlloca(LTy, Name.c_str()); // Store the initial value into the alloca. Builder.CreateStore(Arg, DeclPtr,Ty.isVolatileQualified()); |