diff options
author | Daniel Jasper <djasper@google.com> | 2013-08-21 08:39:01 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-08-21 08:39:01 +0000 |
commit | f110e201e42742318199576d7009d5bc6a22f990 (patch) | |
tree | 22b3055891d2da897c0d230a0f6fb9d99f855af8 /clang/lib/Format/ContinuationIndenter.cpp | |
parent | 179264794242e3fe322ef287e2687c980b2609c5 (diff) | |
download | bcm5719-llvm-f110e201e42742318199576d7009d5bc6a22f990.tar.gz bcm5719-llvm-f110e201e42742318199576d7009d5bc6a22f990.zip |
clang-format: Indent relative to unary operators.
Before:
if (!aaaaaaaaaa( // break
aaaaa)) {
}
After:
if (!aaaaaaaaaa( // break
aaaaa)) {
}
Also cleaned up formatting using clang-format.
llvm-svn: 188891
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index b26d453059f..65f465967f4 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -365,11 +365,13 @@ unsigned ContinuationIndenter::addTokenToState(LineState &State, bool Newline, State.Stack.back().LastSpace = State.Column; else if ((Previous.Type == TT_BinaryOperator || Previous.Type == TT_ConditionalExpr || + Previous.Type == TT_UnaryOperator || Previous.Type == TT_CtorInitializerColon) && !(Previous.getPrecedence() == prec::Assignment && Current.FakeLParens.empty())) // Always indent relative to the RHS of the expression unless this is a - // simple assignment without binary expression on the RHS. + // simple assignment without binary expression on the RHS. Also indent + // relative to unary operators and the colons of constructor initializers. State.Stack.back().LastSpace = State.Column; else if (Previous.Type == TT_InheritanceColon) State.Stack.back().Indent = State.Column; |