This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Use range loops and autos in utils/TableGen/ClangAttrEmitter.cpp
ClosedPublic

Authored by Eugene.Zelenko on Dec 7 2015, 3:34 PM.

Details

Summary

I fixed Clang-tidy modernize-loop-convert and modernize-use-auto. Autos are also used for pointer variables assigned via casts. Patch includes other minor cleanups.

Fixes are in both source and generated code.

Build and regressions were finr on RHEL 6.

Diff Detail

Repository
rL LLVM

Event Timeline

Eugene.Zelenko retitled this revision from to [Clang] Use range loops and autos in utils/TableGen/ClangAttrEmitter.cpp.
Eugene.Zelenko updated this object.
Eugene.Zelenko added reviewers: hans, aaron.ballman.
Eugene.Zelenko set the repository for this revision to rL LLVM.
Eugene.Zelenko added a subscriber: cfe-commits.
aaron.ballman edited edge metadata.Dec 8 2015, 5:34 AM

A few small nits, but mostly looks good. Thank you for this!

utils/TableGen/ClangAttrEmitter.cpp
2404 ↗(On Diff #42116)

I don't think this is the correct change (a const std::foo<bar>::iterator is often different than a std::foo<bar>::const_iterator). I would drop the const since the original is an iterator instead of a const_iterator anyway.

2518 ↗(On Diff #42116)

Same here.

2581 ↗(On Diff #42116)

And here.

Eugene.Zelenko edited edge metadata.
Eugene.Zelenko removed rL LLVM as the repository for this revision.

Replaced const auto with auto as suggested by Aaron.

aaron.ballman accepted this revision.Dec 8 2015, 10:49 AM
aaron.ballman edited edge metadata.

LGTM, thank you!

This revision is now accepted and ready to land.Dec 8 2015, 10:49 AM
This revision was automatically updated to reflect the committed changes.