summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-10-09 09:52:05 +0000
committerDaniel Jasper <djasper@google.com>2014-10-09 09:52:05 +0000
commit18210d7d2f6ecf5f722b2c32023b7c831e11e534 (patch)
tree62334bdd7a250486e233bc8fb01ecf4648c6b902 /clang/lib/Format/ContinuationIndenter.cpp
parente17b55be699f00b349eda9a7d64842af2bd1dd33 (diff)
downloadbcm5719-llvm-18210d7d2f6ecf5f722b2c32023b7c831e11e534.tar.gz
bcm5719-llvm-18210d7d2f6ecf5f722b2c32023b7c831e11e534.zip
clang-format: Add option to control call argument bin-packing separately
This is desirable for the Chromium style guide: http://www.chromium.org/developers/coding-style llvm-svn: 219400
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 9d72994c1bf..ead1da99c2d 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -859,11 +859,13 @@ void ContinuationIndenter::moveStatePastScopeOpener(LineState &State,
NewIndent = Style.ContinuationIndentWidth +
std::max(State.Stack.back().LastSpace,
State.Stack.back().StartOfFunctionCall);
- AvoidBinPacking = !Style.BinPackParameters ||
- (Style.ExperimentalAutoDetectBinPacking &&
- (Current.PackingKind == PPK_OnePerLine ||
- (!BinPackInconclusiveFunctions &&
- Current.PackingKind == PPK_Inconclusive)));
+ AvoidBinPacking =
+ (State.Line->MustBeDeclaration && !Style.BinPackParameters) ||
+ (!State.Line->MustBeDeclaration && !Style.BinPackArguments) ||
+ (Style.ExperimentalAutoDetectBinPacking &&
+ (Current.PackingKind == PPK_OnePerLine ||
+ (!BinPackInconclusiveFunctions &&
+ Current.PackingKind == PPK_Inconclusive)));
// If this '[' opens an ObjC call, determine whether all parameters fit
// into one line and put one per line if they don't.
if (Current.Type == TT_ObjCMethodExpr && Style.ColumnLimit != 0 &&
OpenPOWER on IntegriCloud