aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-29 16:03:49 +0000
committerDaniel Jasper <djasper@google.com>2013-01-29 16:03:49 +0000
commitf1579605adf03f94a2ddddc95c764737ead0efe5 (patch)
treec1c423cba1236b2e830d8b31e4a6958fa707bba6 /lib/Format/Format.cpp
parentf40fb4beaa22b4e53cd8b5319836b361ebfa6c62 (diff)
Allow all parameters on next line for function calls in Chrome.
The style guide only forbids this for function declarations. So, now someFunction( aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa, aaaaaaaaaaaa); Is allowed in Chromium mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 2522d4d5bf..81c8309ef9 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -178,7 +178,7 @@ FormatStyle getLLVMStyle() {
LLVMStyle.IndentCaseLabels = false;
LLVMStyle.SpacesBeforeTrailingComments = 1;
LLVMStyle.BinPackParameters = true;
- LLVMStyle.AllowAllParametersOnNextLine = true;
+ LLVMStyle.AllowAllParametersOfDeclarationOnNextLine = true;
LLVMStyle.AllowReturnTypeOnItsOwnLine = true;
LLVMStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = false;
LLVMStyle.AllowShortIfStatementsOnASingleLine = false;
@@ -196,7 +196,7 @@ FormatStyle getGoogleStyle() {
GoogleStyle.IndentCaseLabels = true;
GoogleStyle.SpacesBeforeTrailingComments = 2;
GoogleStyle.BinPackParameters = false;
- GoogleStyle.AllowAllParametersOnNextLine = true;
+ GoogleStyle.AllowAllParametersOfDeclarationOnNextLine = true;
GoogleStyle.AllowReturnTypeOnItsOwnLine = false;
GoogleStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = true;
GoogleStyle.AllowShortIfStatementsOnASingleLine = false;
@@ -206,7 +206,7 @@ FormatStyle getGoogleStyle() {
FormatStyle getChromiumStyle() {
FormatStyle ChromiumStyle = getGoogleStyle();
- ChromiumStyle.AllowAllParametersOnNextLine = false;
+ ChromiumStyle.AllowAllParametersOfDeclarationOnNextLine = false;
ChromiumStyle.SplitTemplateClosingGreater = true;
return ChromiumStyle;
}
@@ -652,10 +652,11 @@ private:
if (!Style.BinPackParameters && Newline) {
// If we are breaking after '(', '{', '<', this is not bin packing unless
- // AllowAllParametersOnNextLine is false.
+ // AllowAllParametersOfDeclarationOnNextLine is false.
if ((Previous.isNot(tok::l_paren) && Previous.isNot(tok::l_brace) &&
Previous.Type != TT_TemplateOpener) ||
- !Style.AllowAllParametersOnNextLine)
+ (!Style.AllowAllParametersOfDeclarationOnNextLine &&
+ Line.MustBeDeclaration))
State.Stack.back().BreakAfterComma = true;
// Any break on this level means that the parent level has been broken