[llvm-commits] [cfe-commits] TableGen backend API refactoring review request

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Jun 11 08:53:28 PDT 2012


On Jun 10, 2012, at 4:12 PM, Sean Silva wrote:
> 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).

That's not good, we really want tblgen output to be stable. Do you know how to fix it? Otherwise, please file a PR.

> 1-llvm.patch: migrate LLVM tablegen to new API

Committed as r158311.

> 2-clang.patch: migrate Clang tablegen to new API

This patch is making me nervous. The changes to indentation are making it difficult to see what else is happening.

It should be broken into 3:

1. Refactor to avoid TableGenBackend. No functional changes.
2. Unrelated functional changes:

-void ClangAttrLateParsedListEmitter::run(raw_ostream &OS) {
-  OS << "// This file is generated by TableGen. Do not edit.\n\n";
+void EmitClangAttrLateParsedList(RecordKeeper &Records, raw_ostream &OS) {
+  emitSourceFileHeader("Clang Attr Late Parsed List", OS);

3. Indentation.

Thanks,
/jakob





More information about the llvm-commits mailing list