diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-03-22 00:24:14 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-03-22 00:24:14 +0000 |
| commit | f1466848dce9c4c75d96a6cabdc8db560e26aac8 (patch) | |
| tree | 84dc2e5666e691322f482b4001a494542be5a5b6 /lib/CodeGen/CGExpr.cpp | |
| parent | d972678a053d4785772b75cf6c8d4ab74ac2c7f6 (diff) | |
| download | clang-f1466848dce9c4c75d96a6cabdc8db560e26aac8.tar.gz clang-f1466848dce9c4c75d96a6cabdc8db560e26aac8.tar.bz2 clang-f1466848dce9c4c75d96a6cabdc8db560e26aac8.tar.xz | |
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
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index d34b0f5ea3..45cd6a70a5 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -29,7 +29,8 @@ using namespace CodeGen; /// block. llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(const llvm::Type *Ty, const char *Name) { - // FIXME: Should not pass name if names are disabled in IRBuilder. + if (!Builder.isNamePreserving()) + Name = ""; return new llvm::AllocaInst(Ty, 0, Name, AllocaInsertPt); } |
