[PATCH] D13228: clang-format: Extend #include sorting functionality

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 00:40:32 PDT 2015


klimek added inline comments.

================
Comment at: lib/Format/Format.cpp:1665
@@ +1664,3 @@
+
+  // Create pre-compile regular expressions for the #include categories.
+  SmallVector<llvm::Regex, 4> CategoryRegexs;
----------------
pre-compiled

================
Comment at: lib/Format/Format.cpp:1677
@@ +1676,3 @@
+        unsigned Category;
+        if (LookForMainHeader &&! Matches[1].startswith("<")) {
+          Category = 0;
----------------
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?


http://reviews.llvm.org/D13228





More information about the cfe-commits mailing list