Commit Graph

7 Commits

Author SHA1 Message Date
Benjamin Kramer d0eb39232c Teach sort_includes.py to drop duplicated includes.
llvm-svn: 170911
2012-12-21 18:00:08 +00:00
Chandler Carruth c5c675d203 Teach the include sorter to quickly skip files with an extension that
doesn't look like it will have C++ code in it.

Suggestions on a better heuristic are welcome.

llvm-svn: 169248
2012-12-04 10:08:59 +00:00
Chandler Carruth 2aa2a9bf2b Teach the include sorter to skip files under test trees and under INPUTS
trees. This allows running the input sorter on the entire clang
repository cleanly now.

llvm-svn: 169247
2012-12-04 09:59:54 +00:00
Chandler Carruth ed09f456e7 Teach the include sorting script about the gtest headers; sort them with
the system headers.

llvm-svn: 169242
2012-12-04 09:44:38 +00:00
Chandler Carruth 43342d5c88 Address review comments from Matt on the sort_includes.py script.
1) Teach it to handle files with #include on the first line -- these do
   actually exist in LLVM.
2) Support llvm-c and clang-c include projects.
3) Nuke some stail imports.
4) Switch to using os.path to split the file extension off.
5) Remove debugging leftovers.
6) Add docstring (a really puny one) for the sort function.

I'm continuing te avoid stripping the whitespace on the RHS to preserve
whatever newline characters happen to be in the original file.

llvm-svn: 169222
2012-12-04 07:04:58 +00:00
Chandler Carruth 6a451d03c9 Teach the include sorter to not choke on include guards. ;]
Kind of important when prepping the include/... tree version of the sort
changes.

llvm-svn: 169132
2012-12-03 17:01:46 +00:00
Chandler Carruth cba0f3dd7c Add a completely hack-ish tool to sort includes according to the coding
standards.

I am a terrible Python programmer. Patches more the welcome. Please tell
me how this should look if it should look differently. It's just a tiny
little script so it didn't make sense to go through pre-commit review,
especially as someone who actually knows python may want to just rip it
apart and do it The Right Way.

I will be preparing a commit shortly that uses this script to
canonicalize *all* of the #include lines in LLVM. Really, all of them.

llvm-svn: 169125
2012-12-03 14:23:44 +00:00