Ok, this patch set addresses the things you brought up. Sorry about forgetting about the namespace/static thing.<div><br></div><div>Also, I have attached a diff of the .inc files before and after the patch set. Most of the differences are places where I either added a call to `emitSourceFileHeader`, or changed an `OS << "TableGen'erated file"` to a call to emitSourceFileHeader. These changes are benign. There is a peculiar difference in the ARMGenAsmMatcher.inc, where some table entries and `case` labels change order (but are otherwise identical); after a little bit of investigation, I found that the ordering is determined by the iteration order of std::map's with pointers as keys, and hence the orders are inherently unstable, so this should not be problematic (although it may be desirable in the future to make these orders deterministic).</div>
<div><br></div><div>attachments:</div><div>1-llvm.patch: migrate LLVM tablegen to new API</div><div>2-clang.patch: migrate Clang tablegen to new API</div><div>3-llvm.patch: remove struct TableGenBackend and all remnants of the old API</div>
<div>incfiles.diff: the diff of the .inc files before and after the patchset is applied</div><div><br></div><div>--Sean Silva</div><div><br><div class="gmail_quote">On Sun, Jun 10, 2012 at 8:45 AM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk" target="_blank">stoklund@2pi.dk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Jun 8, 2012, at 10:33 PM, Sean Silva <<a href="mailto:silvas@purdue.edu">silvas@purdue.edu</a>> wrote:<br>

<br>
> Ok, these patches address all of your points.<br>
><br>
> 1-llvm.patch is the initial changes to the llvm tree. It changes the backend api for llvm/utils/TableGen/* and it makes some very minor non-breaking changes to include/llvm/TableGen/TableGenBackend.h and lib/TableGen/TableGenBackend.h be make emitSourceFileHeader available as a free function (the member function still exists to not break Clang's TableGen)<br>

> 2-clang.patch changes Clang's TableGen to the new API<br>
> 3-llvm.patch removes struct TableGenBackend and all remnants of the old API.<br>
<br>
</div>Almost there. Please make sure all classes are in anonymous namespaces, and read this:<br>
<br>
<a href="http://llvm.org/docs/CodingStandards.html#micro_anonns" target="_blank">http://llvm.org/docs/CodingStandards.html#micro_anonns</a><br>
<div class="im"><br>
> I built `check` and `clang-test` after applying each one against ToT of the respective repos; all green.<br>
<br>
</div>Please verify that no .inc files change content wih these patches.<br>
<span class="HOEnZb"><font color="#888888"><br>
/jakob<br>
<br>
</font></span></blockquote></div><br></div>