summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2019-04-03 09:25:16 +0000
committerEric Liu <ioeric@google.com>2019-04-03 09:25:16 +0000
commit0f4d5f85191c124d13046ceabc04d5861ae7ab6a (patch)
treeba2a17fe213cbbf05c3dfcd3af7cbd26a57ea9a6 /clang/lib/Format
parentacab05feeeb591b0c3fd265be80e0a01c57f15d8 (diff)
downloadbcm5719-llvm-0f4d5f85191c124d13046ceabc04d5861ae7ab6a.tar.gz
bcm5719-llvm-0f4d5f85191c124d13046ceabc04d5861ae7ab6a.zip
[clang-format] Regroup #includes into blocks for Google style
Summary: Regrouping #includes in blocks separated by blank lines when sorting C++ #include headers was implemented recently, and it has been preferred in Google's C++ style guide: https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes Reviewers: sammccall, klimek Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60116 llvm-svn: 357567
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/Format.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 119be9fae67..4dee599fe01 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -784,6 +784,7 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
GoogleStyle.IncludeStyle.IncludeCategories = {
{"^<ext/.*\\.h>", 2}, {"^<.*\\.h>", 1}, {"^<.*", 2}, {".*", 3}};
GoogleStyle.IncludeStyle.IncludeIsMainRegex = "([-_](test|unittest))?$";
+ GoogleStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Regroup;
GoogleStyle.IndentCaseLabels = true;
GoogleStyle.KeepEmptyLinesAtTheStartOfBlocks = false;
GoogleStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Never;
OpenPOWER on IntegriCloud