aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-11-12 00:01:12 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-11-12 00:01:12 +0000
commit29ea6729155c759836be4b5453bee9ef8e1e97ee (patch)
treed4dfe3b95e980d9e6a18c201e166929485485382
parenta448fb2da03ece39978784793eea68760e8205a1 (diff)
Disable generation of basic block names in NDEBUG mode.
Revert to enabling generation of instruction names when not in NDEBUG mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59094 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGBuilder.h6
-rw-r--r--lib/CodeGen/CodeGenFunction.h4
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/CGBuilder.h b/lib/CodeGen/CGBuilder.h
index 3f59295487..ed56bd9137 100644
--- a/lib/CodeGen/CGBuilder.h
+++ b/lib/CodeGen/CGBuilder.h
@@ -14,8 +14,12 @@
namespace clang {
namespace CodeGen {
- // Don't preserve names on values by default.
+ // Don't preserve names on values in an optimized build.
+#ifdef NDEBUG
typedef llvm::IRBuilder<false> CGBuilderTy;
+#else
+ typedef llvm::IRBuilder<> CGBuilderTy;
+#endif
} // end namespace CodeGen
} // end namespace clang
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 1b573700da..38d9cf31d0 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -222,7 +222,11 @@ public:
llvm::BasicBlock *createBasicBlock(const char *Name="",
llvm::Function *Parent=0,
llvm::BasicBlock *InsertBefore=0) {
+#ifdef NDEBUG
+ return llvm::BasicBlock::Create("", Parent, InsertBefore);
+#else
return llvm::BasicBlock::Create(Name, Parent, InsertBefore);
+#endif
}
/// getBasicBlockForLabel - Return the LLVM basicblock that the specified