diff options
author | David Greene <greened@obbligato.org> | 2011-07-29 19:07:10 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2011-07-29 19:07:10 +0000 |
commit | 0ffd167a01cc44e1c3bddf4d71d772a38834a30b (patch) | |
tree | 7176742f3955a298de625047bd6cd5af1804973e /utils/TableGen | |
parent | ba1ae182876762f17201b33c0b87ca8ede156cfc (diff) | |
download | external_llvm-0ffd167a01cc44e1c3bddf4d71d772a38834a30b.zip external_llvm-0ffd167a01cc44e1c3bddf4d71d772a38834a30b.tar.gz external_llvm-0ffd167a01cc44e1c3bddf4d71d772a38834a30b.tar.bz2 |
[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/TableGen')
-rw-r--r-- | utils/TableGen/Record.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index 0f50df6..3e0038c 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) { |