diff options
author | Daniel Jasper <djasper@google.com> | 2014-05-09 13:11:16 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-05-09 13:11:16 +0000 |
commit | b05a81debb3e717d7b644ec7f136462a68bd6ec8 (patch) | |
tree | 0584b131054e86b97754b549ef7234c34c48490f /clang/lib/Format/FormatToken.cpp | |
parent | f2056bef3246f93ae272cb7322da9618b08f7e05 (diff) | |
download | bcm5719-llvm-b05a81debb3e717d7b644ec7f136462a68bd6ec8.tar.gz bcm5719-llvm-b05a81debb3e717d7b644ec7f136462a68bd6ec8.zip |
clang-format: Fix bug introduced by r208392.
Also run clang-format over clang-format's files.
llvm-svn: 208409
Diffstat (limited to 'clang/lib/Format/FormatToken.cpp')
-rw-r--r-- | clang/lib/Format/FormatToken.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp index 5bc5acaebea..c91d25f46de 100644 --- a/clang/lib/Format/FormatToken.cpp +++ b/clang/lib/Format/FormatToken.cpp @@ -64,16 +64,15 @@ unsigned CommaSeparatedList::formatAfterToken(LineState &State, // Ensure that we start on the opening brace. const FormatToken *LBrace = State.NextToken->Previous->Previous; - if (LBrace->isNot(tok::l_brace) || - LBrace->BlockKind == BK_Block || + if (LBrace->isNot(tok::l_brace) || LBrace->BlockKind == BK_Block || LBrace->Type == TT_DictLiteral || LBrace->Next->Type == TT_DesignatedInitializerPeriod) return 0; // Calculate the number of code points we have to format this list. As the // first token is already placed, we have to subtract it. - unsigned RemainingCodePoints = Style.ColumnLimit - State.Column + - State.NextToken->Previous->ColumnWidth; + unsigned RemainingCodePoints = + Style.ColumnLimit - State.Column + State.NextToken->Previous->ColumnWidth; // Find the best ColumnFormat, i.e. the best number of columns to use. const ColumnFormat *Format = getColumnFormat(RemainingCodePoints); @@ -186,8 +185,7 @@ void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) { // If this doesn't have a nested list, we require at least 6 elements in order // create a column layout. If it has a nested list, column layout ensures one // list element per line. - if (HasNestedBracedList || Commas.size() < 5 || - Token->NestingLevel != 0) + if (HasNestedBracedList || Commas.size() < 5 || Token->NestingLevel != 0) return; // We can never place more than ColumnLimit / 3 items in a row (because of the @@ -209,8 +207,7 @@ void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) { HasRowWithSufficientColumns = true; unsigned length = (Column == Columns - 1) ? EndOfLineItemLength[i] : ItemLengths[i]; - Format.ColumnSizes[Column] = - std::max(Format.ColumnSizes[Column], length); + Format.ColumnSizes[Column] = std::max(Format.ColumnSizes[Column], length); ++Column; } // If all rows are terminated early (e.g. by trailing comments), we don't |