This is an archive of the discontinued LLVM Phabricator instance.

[PP] Replace some index based for loops with range based ones
ClosedPublic

Authored by erikjv on Oct 26 2016, 4:43 AM.

Details

Summary

While in the area, also change some unsigned variables to size_t, and
introduce an LLVM_FALLTHROUGH instead of a comment stating that.

Diff Detail

Event Timeline

erikjv updated this revision to Diff 75852.Oct 26 2016, 4:43 AM
erikjv retitled this revision from to [PP] Replace some index based for loops with range based ones.
erikjv updated this object.
erikjv added a reviewer: bkramer.
erikjv added a subscriber: cfe-commits.
bkramer added inline comments.Oct 26 2016, 4:55 AM
lib/Lex/PPLexerChange.cpp
42–43

This wasn't a reverse loop?

Also I think at this point writing it with none_of is more readable:

return std::none_of(IncludeMacroStack.begin() + 1, IncludeMacroStack.end(), IsFileLexer);
erikjv updated this revision to Diff 75854.Oct 26 2016, 5:05 AM
erikjv marked an inline comment as done.
bkramer accepted this revision.Oct 26 2016, 5:19 AM
bkramer edited edge metadata.

lgtm

This revision is now accepted and ready to land.Oct 26 2016, 5:19 AM
This revision was automatically updated to reflect the committed changes.