This is an archive of the discontinued LLVM Phabricator instance.

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

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

Details

Summary

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.
llvm/utils/TableGen/CodeGenRegisters.cpp
587

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

llvm/utils/TableGen/CodeGenSchedule.cpp
1787

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

1953

Why can't this be on one line now?

1953

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.

1962

Single line?

This revision was automatically updated to reflect the committed changes.