summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-08-21 08:39:01 +0000
committerDaniel Jasper <djasper@google.com>2013-08-21 08:39:01 +0000
commitf110e201e42742318199576d7009d5bc6a22f990 (patch)
tree22b3055891d2da897c0d230a0f6fb9d99f855af8 /clang/lib/Format/ContinuationIndenter.cpp
parent179264794242e3fe322ef287e2687c980b2609c5 (diff)
downloadbcm5719-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.cpp4
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;
OpenPOWER on IntegriCloud