From 0ffd167a01cc44e1c3bddf4d71d772a38834a30b Mon Sep 17 00:00:00 2001 From: David Greene Date: Fri, 29 Jul 2011 19:07:10 +0000 Subject: [PATCH] [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 --- utils/TableGen/Record.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index 0f50df69d7d..3e0038c9e67 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 Range) {