<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey Chris,<div><br></div><div>Ok, so I'm working on creating this trivial patch, for starters, but I'm trying to identify</div><div>a controlled unit test for tblgen. So all of the following test tblgen to various extents:</div><div><br></div><div>1) make</div><div>2) make unittests</div><div>3) make // with clang</div><div><br></div><div>and</div><div><br></div><div>4) make check // which I'm avoiding</div><div><br></div><div>Since I'm just starting to understand tblgen, I'm not comfortable with any of these</div><div>approaches (although I'm currently using make, with clang, and make unittests). I did not find </div><div>any td files under unittests, and therefore am of the opinion such a direct unit test does </div><div>not exist. Is this correct?</div><div><br></div><div>The end result is that I'll be submitting the patch to the group so someone else can</div><div>commit it, and I will do this when I find out what is going on with these new clang</div><div>enum comparison warnings.</div><div><br></div><div>Sorry for the noise for such an extremely trivial patch, but I'm rusty, and tblgen</div><div>is new to me. My current short term goal is to understand tblgen, by getting rid</div><div>of its global dependencies, and subsequently modify it to use a portable dlopen</div><div>like semantic so that one can plugin tblgen backends. Does this exist already?</div><div>Is anyone else interested in this? I'm interested in backends that accomplish </div><div>results similar to those generated by clang's tblgen use. I think the options framework </div><div>will work with a delayed option instantiation (through dlopen). I'm thinking one </div><div>command line flag would trigger, the dlopen of the specified library, and subsequent </div><div>flags would specify the action to take, each library having its own globally defined </div><div>options. Could be some interference here from command line arguments not </div><div>understood by the initial option action list, but I'm under the current impression that </div><div>at least the global holding the option list (RegisteredOptionList) can be modified </div><div>after the fact. I'll check further when I get there.</div><div><br></div><div>Now if only work would get out of the way. ;-)</div><div><br></div><div>Garrison</div><div><br><div><div>On Dec 9, 2010, at 18:32, Chris Lattner wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 9, 2010, at 4:50 AM, Garrison Venn wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Is there a reason that RecordKeeper:: getAllDerivedDefinitions(...) implementation <div>accesses the global Records instance instead of just referencing itself?<div><br></div><div>As far as I can tell from the usage:</div><div><br></div><div>1) Records has the linkage as extern RecordKeeper Records in Record.h</div><div>2) Is instantiated as a global in TableGen</div><div>3) All llvm uses of getAllDerivedDefinitions SEEM to be manifested as a </div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>message to this global RecordKeeper</div></div><div><br></div></blockquote>In short getAllDerivedDefinitions(...) sort of (non-static) treats RecordKeeper <div>as a singleton but it is never accessed this way. It is always accessed via</div><div>the global: Records.</div></div></blockquote><br></div><div>Hi Garrison,</div><div><br></div><div>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!</div><div><br></div><div>-Chris</div><br></div></blockquote></div><br></div></body></html>