Teach the include sorter to not choke on include guards. ;]
authorChandler Carruth <chandlerc@gmail.com>
Mon, 3 Dec 2012 17:01:46 +0000 (17:01 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 3 Dec 2012 17:01:46 +0000 (17:01 +0000)
Kind of important when prepping the include/... tree version of the sort
changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169132 91177308-0d34-0410-b5e6-96231b3b80d8

utils/sort_includes.py

index 6f20cb76e4831c52e6b3e69858a779050a7dddb3..81095d63585affb6c7b2b5f13ddb1d9e7fcf681b 100755 (executable)
@@ -48,7 +48,7 @@ def sort_includes(f):
     # mixed with includes, the order might be sensitive.
     if headers_begin != 0:
       break
-    if l.startswith('//') or l.startswith('#define'):
+    if l.startswith('//') or l.startswith('#define') or l.startswith('#ifndef'):
       continue
     break
   if headers_begin == 0: