diff --git a/llvm/utils/TableGen/Record.cpp b/llvm/utils/TableGen/Record.cpp index 0f50df69d7d4..3e0038c9e674 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) {