diff options
author | Jacek Olesiak <jolesiak@google.com> | 2018-05-22 16:44:42 +0000 |
---|---|---|
committer | Jacek Olesiak <jolesiak@google.com> | 2018-05-22 16:44:42 +0000 |
commit | f51ce777e3a6904690434256b695e0359edb4118 (patch) | |
tree | 4e9964813f8420a17a5ce93f2ab825336e5ddf2c /clang/lib | |
parent | 4c7763eb2f3175b772d199424ffe3bdf52e7ee76 (diff) | |
download | bcm5719-llvm-f51ce777e3a6904690434256b695e0359edb4118.tar.gz bcm5719-llvm-f51ce777e3a6904690434256b695e0359edb4118.zip |
Revert "[clang-format] Fix putting ObjC message arguments in one line for multiline receiver"
Summary: Reverts D46879
Reviewers: benhamilton
Reviewed By: benhamilton
Subscribers: krasimir, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D47205
llvm-svn: 332998
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index fe6a9568396..441df05a52d 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -1073,34 +1073,8 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State, if (Current.isMemberAccess()) State.Stack.back().StartOfFunctionCall = !Current.NextOperator ? 0 : State.Column; - if (Current.is(TT_SelectorName) && - !State.Stack.back().ObjCSelectorNameFound) { + if (Current.is(TT_SelectorName)) State.Stack.back().ObjCSelectorNameFound = true; - - // Reevaluate whether ObjC message arguments fit into one line. - // If a receiver spans multiple lines, e.g.: - // [[object block:^{ - // return 42; - // }] a:42 b:42]; - // BreakBeforeParameter is calculated based on an incorrect assumption - // (it is checked whether the whole expression fits into one line without - // considering a line break inside a message receiver). - if (Current.Previous && Current.Previous->closesScope() && - Current.Previous->MatchingParen && - Current.Previous->MatchingParen->Previous) { - const FormatToken &CurrentScopeOpener = - *Current.Previous->MatchingParen->Previous; - if (CurrentScopeOpener.is(TT_ObjCMethodExpr) && - CurrentScopeOpener.MatchingParen) { - int NecessarySpaceInLine = - getLengthToMatchingParen(CurrentScopeOpener, State.Stack) + - CurrentScopeOpener.TotalLength - Current.TotalLength - 1; - if (State.Column + Current.ColumnWidth + NecessarySpaceInLine <= - Style.ColumnLimit) - State.Stack.back().BreakBeforeParameter = false; - } - } - } if (Current.is(TT_CtorInitializerColon) && Style.BreakConstructorInitializers != FormatStyle::BCIS_AfterColon) { // Indent 2 from the column, so: |