[AVX] Unique BitInit
Keep only two copies of BitInit: one for true and one for false.
llvm-svn: 136488
diff --git a/llvm/utils/TableGen/Record.cpp b/llvm/utils/TableGen/Record.cpp
index 0f50df6..3e0038c 100644
--- a/llvm/utils/TableGen/Record.cpp
+++ b/llvm/utils/TableGen/Record.cpp
@@ -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) {