aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-10-07 04:06:10 +0000
committerDaniel Jasper <djasper@google.com>2015-10-07 04:06:10 +0000
commit55bbe664bd13fdfe1ba5d9d1600e1b3075b3847c (patch)
treea9f6d8b8e0690dd6db412436c5f4c36d340c867d /clang/lib/Format/Format.cpp
parente782f673a88b0decbba4a25c5572f3a1ffeb7725 (diff)
downloadllvm-55bbe664bd13fdfe1ba5d9d1600e1b3075b3847c.zip
llvm-55bbe664bd13fdfe1ba5d9d1600e1b3075b3847c.tar.gz
llvm-55bbe664bd13fdfe1ba5d9d1600e1b3075b3847c.tar.bz2
Make clang-format actually respect custom brace wrapping flags.
This fixes llvm.org/PR25073. llvm-svn: 249519
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index e9a02a0..6bfd9cb 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -372,6 +372,8 @@ std::string ParseErrorCategory::message(int EV) const {
}
static FormatStyle expandPresets(const FormatStyle &Style) {
+ if (Style.BreakBeforeBraces == FormatStyle::BS_Custom)
+ return Style;
FormatStyle Expanded = Style;
Expanded.BraceWrapping = {false, false, false, false, false, false,
false, false, false, false, false};
@@ -442,6 +444,8 @@ FormatStyle getLLVMStyle() {
LLVMStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_None;
LLVMStyle.BreakBeforeTernaryOperators = true;
LLVMStyle.BreakBeforeBraces = FormatStyle::BS_Attach;
+ LLVMStyle.BraceWrapping = {false, false, false, false, false, false,
+ false, false, false, false, false};
LLVMStyle.BreakConstructorInitializersBeforeComma = false;
LLVMStyle.ColumnLimit = 80;
LLVMStyle.CommentPragmas = "^ IWYU pragma:";