[PATCH] D67843: DisableFormat also now disables SortIncludes
Sam Maier via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 20 10:48:01 PDT 2019
SamMaier updated this revision to Diff 221065.
SamMaier added a comment.
Diff with more context
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67843/new/
https://reviews.llvm.org/D67843
Files:
clang/lib/Format/Format.cpp
clang/test/Format/disable-format.cpp
Index: clang/test/Format/disable-format.cpp
===================================================================
--- clang/test/Format/disable-format.cpp
+++ clang/test/Format/disable-format.cpp
@@ -1,5 +1,9 @@
// RUN: grep -Ev "// *[A-Z-]+:" %s | clang-format -style=none \
// RUN: | FileCheck -strict-whitespace %s
-// CHECK: int i;
+// CHECK: #include <b>
+// CHECK-NEXT: #include <a>
+// CHECK-NEXT: int i;
+#include <b>
+#include <a>
int i;
Index: clang/lib/Format/Format.cpp
===================================================================
--- clang/lib/Format/Format.cpp
+++ clang/lib/Format/Format.cpp
@@ -1062,8 +1062,6 @@
FormatStyle getNoStyle() {
FormatStyle NoStyle = getLLVMStyle();
NoStyle.DisableFormat = true;
- NoStyle.SortIncludes = false;
- NoStyle.SortUsingDeclarations = false;
return NoStyle;
}
@@ -2130,7 +2128,7 @@
ArrayRef<tooling::Range> Ranges,
StringRef FileName, unsigned *Cursor) {
tooling::Replacements Replaces;
- if (!Style.SortIncludes)
+ if (!Style.SortIncludes || Style.DisableFormat)
return Replaces;
if (isLikelyXml(Code))
return Replaces;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67843.221065.patch
Type: text/x-patch
Size: 1199 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190920/db7a8914/attachment.bin>
More information about the cfe-commits
mailing list