summaryrefslogtreecommitdiff
path: root/utils
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
commit0ffd167a01cc44e1c3bddf4d71d772a38834a30b (patch)
tree7176742f3955a298de625047bd6cd5af1804973e /utils
parentba1ae182876762f17201b33c0b87ca8ede156cfc (diff)
downloadllvm-0ffd167a01cc44e1c3bddf4d71d772a38834a30b.tar.gz
llvm-0ffd167a01cc44e1c3bddf4d71d772a38834a30b.tar.bz2
llvm-0ffd167a01cc44e1c3bddf4d71d772a38834a30b.tar.xz
[AVX] Unique BitInit
Keep only two copies of BitInit: one for true and one for false. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/Record.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp
index 0f50df69d7..3e0038c9e6 100644
--- a/utils/TableGen/Record.cpp
+++ b/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) {