summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-05-15 08:30:06 +0000
committerDaniel Jasper <djasper@google.com>2013-05-15 08:30:06 +0000
commit00aca707d58af0b4ec48466e691984d6353efa10 (patch)
treedbd399cf294bd7be982b5223338060533ed602bc /clang/lib/Format/Format.cpp
parentd2ae41a7c6aa6aea65421d611ccd6f7394855506 (diff)
downloadbcm5719-llvm-00aca707d58af0b4ec48466e691984d6353efa10.tar.gz
bcm5719-llvm-00aca707d58af0b4ec48466e691984d6353efa10.zip
Don't merge one-line functions in weird brace styles.
llvm-svn: 181872
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 6472a1f10d0..99521ea8ccd 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1341,7 +1341,8 @@ private:
if (I + 1 == E || (I + 1)->Type == LT_Invalid)
return;
- if (I->Last->is(tok::l_brace)) {
+ if (I->Last->is(tok::l_brace) &&
+ Style.BreakBeforeBraces == FormatStyle::BS_Attach) {
tryMergeSimpleBlock(I, E, Limit);
} else if (I->First.is(tok::kw_if)) {
tryMergeSimpleIf(I, E, Limit);
OpenPOWER on IntegriCloud