diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp index c962fb3..ab75e31 100644 --- a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp @@ -66,11 +66,15 @@ static int getPriority(StringRef Filename, bool IsAngled, bool IsMainModule) { Filename.startswith("clang/") || Filename.startswith("clang-c/")) return 2; - // System headers are sorted to the end. - if (IsAngled || Filename.startswith("gtest/") || - Filename.startswith("gmock/")) + // Put these between system and llvm headers to be consistent with LLVM + // clang-format style. + if (Filename.startswith("gtest/") || Filename.startswith("gmock/")) return 3; + // System headers are sorted to the end. + if (IsAngled) + return 4; + // Other headers are inserted between the main module header and LLVM headers. return 1; } |