From 18210d7d2f6ecf5f722b2c32023b7c831e11e534 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 9 Oct 2014 09:52:05 +0000 Subject: 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 --- clang/lib/Format/ContinuationIndenter.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'clang/lib/Format/ContinuationIndenter.cpp') 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 && -- cgit v1.2.3