[LLVMdev] tblgen internals
Chris Lattner
clattner at apple.com
Thu Dec 9 15:32:54 PST 2010
On Dec 9, 2010, at 4:50 AM, Garrison Venn wrote:
> Is there a reason that RecordKeeper:: getAllDerivedDefinitions(...) implementation
> accesses the global Records instance instead of just referencing itself?
>
> As far as I can tell from the usage:
>
> 1) Records has the linkage as extern RecordKeeper Records in Record.h
> 2) Is instantiated as a global in TableGen
> 3) All llvm uses of getAllDerivedDefinitions SEEM to be manifested as a
> message to this global RecordKeeper
>
> In short getAllDerivedDefinitions(...) sort of (non-static) treats RecordKeeper
> as a singleton but it is never accessed this way. It is always accessed via
> the global: Records.
Hi Garrison,
There is no good reason. This is one of many instances of tblgen just being poorly designed because noone gives it much love. It would be great if you could send in or commit a patch to tidy this up, thanks!
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101209/a8b86a52/attachment.html>
More information about the llvm-dev
mailing list