From f1466848dce9c4c75d96a6cabdc8db560e26aac8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 22 Mar 2009 00:24:14 +0000 Subject: fix CreateTempAlloca to not set a name on the alloca for temporaries in release-assert builds. For automatic variables, explicitly set a name with setName that does not make a temporary std::string. This speeds up -emit-llvm-only -disable-free on PR3810 by 4.6% git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67459 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CodeGenFunction.cpp') diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 441c9fcdbf..1d9f0f844e 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -163,9 +163,11 @@ void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy, // later. Don't create this with the builder, because we don't want it // folded. llvm::Value *Undef = llvm::UndefValue::get(llvm::Type::Int32Ty); - AllocaInsertPt = new llvm::BitCastInst(Undef, llvm::Type::Int32Ty, "allocapt", + AllocaInsertPt = new llvm::BitCastInst(Undef, llvm::Type::Int32Ty, "", EntryBB); - + if (Builder.isNamePreserving()) + AllocaInsertPt->setName("allocapt"); + ReturnBlock = createBasicBlock("return"); ReturnValue = 0; if (!RetTy->isVoidType()) -- cgit v1.2.3-18-g5258