This is an archive of the discontinued LLVM Phabricator instance.

clang-format: Extend #include sorting functionality
ClosedPublic

Authored by djasper on Sep 28 2015, 2:50 PM.

Details

Reviewers
klimek
Summary

Recognize main module header as well as different #include categories. This should now mimic the behavior of llvm/utils/sort_includes.py as well as clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp very closely.

Diff Detail

Event Timeline

djasper updated this revision to Diff 35909.Sep 28 2015, 2:50 PM
djasper retitled this revision from to clang-format: Extend #include sorting functionality.
djasper updated this object.
djasper added a reviewer: klimek.
djasper added a subscriber: cfe-commits.
klimek added inline comments.Sep 29 2015, 12:40 AM
lib/Format/Format.cpp
1665

pre-compiled

1677

Run clang-format.

Also, shouldn't we try to figure out whether the name matches, instead of simply assuming the first one is the main header?

djasper marked an inline comment as done.Sep 29 2015, 12:48 AM
djasper added inline comments.
lib/Format/Format.cpp
1677

Ran clang-format and added a comment.

klimek accepted this revision.Sep 29 2015, 12:49 AM
klimek edited edge metadata.

lg

This revision is now accepted and ready to land.Sep 29 2015, 12:49 AM
djasper closed this revision.Sep 29 2015, 12:55 AM

Submitted as r248782.