[llvm-commits] [PATCH 06/20] [AVX] Unique UnsetInit
David A. Greene
dag at cray.com
Wed Jul 20 08:59:34 PDT 2011
Jakob Stoklund Olesen <stoklund at 2pi.dk> writes:
>> const UnsetInit *UnsetInit::get() {
>> - return new UnsetInit;
>> + static const UnsetInit *TheInit = 0;
>> + if (TheInit == 0)
>> + TheInit = new UnsetInit();
>> +
>> + return TheInit;
>> }
>
> Why use a pointer instead of just a static object?
Already fixed. Someone beat you to it. :)
-Dave
More information about the llvm-commits
mailing list