diff options
Diffstat (limited to 'utils/TableGen/Record.cpp')
-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 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) { |