diff options
author | Daniel Jasper <djasper@google.com> | 2014-10-09 09:52:05 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-10-09 09:52:05 +0000 |
commit | 18210d7d2f6ecf5f722b2c32023b7c831e11e534 (patch) | |
tree | 62334bdd7a250486e233bc8fb01ecf4648c6b902 /clang/lib/Format/ContinuationIndenter.cpp | |
parent | e17b55be699f00b349eda9a7d64842af2bd1dd33 (diff) | |
download | bcm5719-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.cpp | 12 |
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 && |