[LLVMdev] tblgen internals

Garrison Venn gvenn.cfe.dev at gmail.com
Mon Dec 13 05:49:07 PST 2010


The attached patch removes Record::createRecord(...) and its uses from trunk, and includes
previous code style fixes. 

On Dec 12, 2010, at 21:52, Garrison Venn wrote:

> ...
> 
>> 
>> Another random question: why is createRecord better than using "new Record"?  If createRecord is better, it would be good to make the Record ctor private so the code doesn't evolve into sometimes using one and sometimes using the other.
> 
> This was another syntactic hack. I personally prefer the factory approach, but I cannot
> as it stands get rid of the explicit Record constructor because of MultiClass. It has member
> variable of type Record and constructs this member directly using the Record constructor.
> It therefore does not need the allocation provided by createRecord. I could push the Record
> constructor to protected or private and make MultiClass a friend. This is ugly so I think I should 
> drop the factory method in favor of new Record. Like I said the factory method is mainly sugar 
> anyway.
> 
> I'm assuming your ok with dropping the RecordKeeper::createRecord(...). I'll send that
> patch tomorrow.
> 
> ...
>> Some minor coding style things:
>> 
>> ...
> 
>> -Chris
>> 
> 
> <RecordKeeper.4.patch>

I think you will be ok with this.

Garrison

PS: Standalone patch with respect to trunk 121697





More information about the llvm-dev mailing list