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

Sean Silva silvas at purdue.edu
Tue Jun 12 19:55:20 PDT 2012


Here is a new patch updating the Clang API. It is just the minimal changes
to move over to the new API. The .inc files are bit-identical. For now,
I'll postpone 2 and 3 for a more general TableGen "cleanup" patch-set at
some unspecified time in the future unless you strongly feel otherwise.

After this patch, you should be able to apply 3-llvm.patch from the
previous email and fully remove the old API.

I will see what I can do to ensure deterministic iteration order. I also
have some major TableGen docs updates in the works.

--Sean Silva

On Mon, Jun 11, 2012 at 8:53 AM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:

>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120612/b098383a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2-clang.patch
Type: application/octet-stream
Size: 42836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120612/b098383a/attachment.obj>


More information about the llvm-commits mailing list