diff options
author | Daniel Jasper <djasper@google.com> | 2014-03-27 09:43:54 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-03-27 09:43:54 +0000 |
commit | c13ee34378f14733692c2714d02549563fa16431 (patch) | |
tree | 4385540eca93a0beb9ab8671ccf7da52e8f2a870 /clang/lib/Format/ContinuationIndenter.cpp | |
parent | b714601f8f0132fdced747de34752ee63d2bdc86 (diff) | |
download | bcm5719-llvm-c13ee34378f14733692c2714d02549563fa16431.tar.gz bcm5719-llvm-c13ee34378f14733692c2714d02549563fa16431.zip |
clang-format: Correctly identify ObjC Block with return type.
llvm-svn: 204905
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index cb4e4f53b2f..431be41e0a3 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -636,16 +636,11 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State, } State.Stack.pop_back(); } - bool IsObjCBlock = - Previous && - (Previous->is(tok::caret) || - (Previous->is(tok::r_paren) && Previous->MatchingParen && - Previous->MatchingParen->Previous && - Previous->MatchingParen->Previous->is(tok::caret))); // For some reason, ObjC blocks are indented like continuations. NewIndent = - State.Stack.back().LastSpace + - (IsObjCBlock ? Style.ContinuationIndentWidth : Style.IndentWidth); + State.Stack.back().LastSpace + (Current.Type == TT_ObjCBlockLBrace + ? Style.ContinuationIndentWidth + : Style.IndentWidth); ++NewIndentLevel; BreakBeforeParameter = true; } else { |