This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Use range-based for loops (NFC)

Authored by CoelacanthusHex on May 6 2021, 6:34 AM.



Use range-based for loops in TableGen.

Diff Detail

Event Timeline

CoelacanthusHex created this revision.May 6 2021, 6:34 AM
CoelacanthusHex requested review of this revision.May 6 2021, 6:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2021, 6:34 AM

Nice cleanup! I presume this passes all the TableGen tests?

I guess you should capitalize all the range iterator variables.

I guess you should capitalize all the range iterator variables.

OK, done

LGTM. Just please verify that it passes all the TableGen tests.

This revision is now accepted and ready to land.May 6 2021, 9:16 AM
craig.topper added inline comments.

Code in LLVM almost always uses "unsigned" instead of "unsigned int". This occurs several more times.


Why are reference? Isn't ProctResourceDef a Record *?


Why can't this be on one line now?


This is a pointer so should be "auto *". LLVM prefers not to obscure pointers with auto. I think this applies to other places in the patch. We might even want "Record *" here. We're pretty conservative about auto unless the type is obvious for the reader.


Single line?

This revision was automatically updated to reflect the committed changes.