[llvm-commits] [llvm] r136488 - /llvm/trunk/utils/TableGen/Record.cpp

David Greene greened at obbligato.org
Fri Jul 29 12:07:10 PDT 2011


Author: greened
Date: Fri Jul 29 14:07:10 2011
New Revision: 136488

URL: http://llvm.org/viewvc/llvm-project?rev=136488&view=rev
Log:
[AVX] Unique BitInit

Keep only two copies of BitInit: one for true and one for false.

Modified:
    llvm/trunk/utils/TableGen/Record.cpp

Modified: llvm/trunk/utils/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/Record.cpp?rev=136488&r1=136487&r2=136488&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/Record.cpp (original)
+++ llvm/trunk/utils/TableGen/Record.cpp Fri Jul 29 14:07:10 2011
@@ -1,3 +1,4 @@
+
 //===- Record.cpp - Record implementation ---------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -448,7 +449,10 @@
 }
 
 const BitInit *BitInit::get(bool V) {
-  return new BitInit(V);
+  static const BitInit True(true);
+  static const BitInit False(false);
+
+  return V ? &True : &False;
 }
 
 const BitsInit *BitsInit::get(ArrayRef<const Init *> Range) {





More information about the llvm-commits mailing list