]> granicus.if.org Git - clang/commitdiff
Disable generation of basic block names in NDEBUG mode.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 12 Nov 2008 00:01:12 +0000 (00:01 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 12 Nov 2008 00:01:12 +0000 (00:01 +0000)
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

lib/CodeGen/CGBuilder.h
lib/CodeGen/CodeGenFunction.h

index 3f592954875ef5f3435f04150f1dd0a27d29427e..ed56bd913779092a137a93696376ebbb4244c0ba 100644 (file)
 
 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
 
index 1b573700da1a92a3c4f7c22b43eea76a0e1aa902..38d9cf31d0e2a14bd62662a902f9934c1545e703 100644 (file)
@@ -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