This is an archive of the discontinued LLVM Phabricator instance.

TableGen: Add !foldl operation
ClosedPublic

Authored by nhaehnle on Mar 5 2018, 12:17 PM.

Details

Summary

Change-Id: I63d67bf6e0b315e2d3360e47e3b62c9517f38987

Diff Detail

Event Timeline

nhaehnle created this revision.Mar 5 2018, 12:17 PM
tra accepted this revision.Mar 5 2018, 5:14 PM

LGTM. Few minor style questions.

docs/TableGen/LangRef.rst
98–101

Should we sort them?

lib/TableGen/TGParser.cpp
1251–1252

Would it make sense to print StartUntyped here, too? I often find TableGen failures baffling, specifically because tablegen will usually (sometimes?) tell you *where* tablegen ran into the problem, but it rarely tells you what exactly it saw after all the folding that made it unhappy. Better error reporting in general should probably be a patch, but I doubt there will be many voices against better error reporting in new code. :-)

1251–1258

You seem to mix fold and !foldl in the error messages throughout the function. Is that intentional? I'd use !foldl everywhere for consistency.

This revision is now accepted and ready to land.Mar 5 2018, 5:14 PM
nhaehnle closed this revision.Mar 6 2018, 5:54 AM
nhaehnle marked 2 inline comments as done.

r326790

docs/TableGen/LangRef.rst
98–101

Probably a good idea at some point, but I'd rather not do it in this commit to avoid conflicts with later changes.

lib/TableGen/TGParser.cpp
1251–1252

Yup, makes sense, I've added that, same with ListUntyped below.

1251–1258

You're right, I've changed all the messages to say !foldl consistently.