summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2011-07-29 19:07:10 +0000
committerDavid Greene <greened@obbligato.org>2011-07-29 19:07:10 +0000
commit772b2c6bf14f6d2deebedebb08d2096928222e76 (patch)
tree7f2a243e8b4c02f4c7cb384f6bb7d65510604ecd
parent377e12cf75b33e41a8b59d2d620f6653dec16528 (diff)
downloadbcm5719-llvm-772b2c6bf14f6d2deebedebb08d2096928222e76.tar.gz
bcm5719-llvm-772b2c6bf14f6d2deebedebb08d2096928222e76.zip
[AVX] Unique BitInit
Keep only two copies of BitInit: one for true and one for false. llvm-svn: 136488
-rw-r--r--llvm/utils/TableGen/Record.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/Record.cpp b/llvm/utils/TableGen/Record.cpp
index 0f50df69d7d..3e0038c9e67 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 UnsetInit *UnsetInit::get() {
}
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) {
OpenPOWER on IntegriCloud