[llvm-commits] [PATCH] Make TableGen Inits FoldingSetNodes

John McCall rjmccall at apple.com
Mon Jul 11 12:16:55 PDT 2011


On Jul 11, 2011, at 12:02 PM, David A. Greene wrote:
> Jakob Stoklund Olesen <stoklund at 2pi.dk> writes:
>> On Jul 8, 2011, at 9:41 AM, David Greene wrote:
>> 
>>    Here's a patch to manage TableGen Inits using a FoldingSet.  This allows
>>    us to clean up all of the allocated Inits on TableGen exit, saves memory
>>    and makes TableGen run a bit faster due to elimination of duplicate
>>    objects.
>> 
>> Very nice. Please use get() instead of Create().
> 
> Is there a naming convention here?  I've seen Create() used in other
> places, which is why I used it.  :)

The convention, as I see it, is to use 'create' for factory methods that
return a non-uniqued object and 'get' for factory methods that return
a uniqued object.  Note that I have no idea which category this falls
into.

John.



More information about the llvm-commits mailing list