This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Don't quote variable name when printing !foreach.
ClosedPublic

Authored by simon_tatham on May 2 2018, 1:59 AM.

Details

Summary

An input !foreach expression such as !foreach(a, lst, !add(a, 1))
would be re-emitted by llvm-tblgen -print-records with the first
argument in quotes, giving !foreach("a", lst, !add(a, 1)), which isn't
valid TableGen input syntax.

Diff Detail

Repository
rL LLVM

Event Timeline

simon_tatham created this revision.May 2 2018, 1:59 AM

I happened to notice this minor discrepancy in the course of writing the original version of D46054 (which dumped all the interesting unresolved expression nodes as well as the concrete final values). It's not important, I admit, but it briefly confused me about what the right syntax for !foreach was, so I thought it would be worth fixing for that reason alone.

nhaehnle accepted this revision.May 2 2018, 6:07 AM

Good catch! I agree that this is a very useful change.

This revision is now accepted and ready to land.May 2 2018, 6:07 AM
This revision was automatically updated to reflect the committed changes.