There are still a couple of rough edges in here but it is working fine on LLVM and generates the same results as sort_includes.py if there are no blank lines involved. Differential Revision: http://reviews.llvm.org/D4741 llvm-svn: 215152