<div dir="ltr">Yeah.. We really need to implement that comment-reflow logic...</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 17, 2015 at 6:41 PM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Wed, Jun 17, 2015 at 6:08 AM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: djasper<br>
Date: Wed Jun 17 08:08:06 2015<br>
New Revision: 239903<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D239903-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=Ddo0REGvmI1v39nolN6KKNJhkqOXifDCwWEltroZvYs&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=239903&view=rev</a><br>
Log:<br>
clang-format: clang-format (NFC)<br>
<br>
Modified:<br>
cfe/trunk/lib/Format/BreakableToken.cpp<br>
cfe/trunk/lib/Format/ContinuationIndenter.cpp<br>
cfe/trunk/lib/Format/Format.cpp<br>
cfe/trunk/lib/Format/FormatToken.h<br>
cfe/trunk/lib/Format/TokenAnnotator.cpp<br>
cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp<br>
cfe/trunk/lib/Format/UnwrappedLineFormatter.h<br>
cfe/trunk/lib/Format/UnwrappedLineParser.cpp<br>
cfe/trunk/lib/Format/WhitespaceManager.h<br>
cfe/trunk/unittests/Format/FormatTest.cpp<br>
cfe/trunk/unittests/Format/FormatTestJS.cpp<br>
cfe/trunk/unittests/Format/FormatTestJava.cpp<br>
<br>
Modified: cfe/trunk/lib/Format/BreakableToken.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Format_BreakableToken.cpp-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=7qJbP5AOU4gd-8b1pEdFDDoooPaoimW92K5cU2eb9zA&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/BreakableToken.cpp?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/BreakableToken.cpp (original)<br>
+++ cfe/trunk/lib/Format/BreakableToken.cpp Wed Jun 17 08:08:06 2015<br>
@@ -183,7 +183,7 @@ void BreakableStringLiteral::insertBreak<br>
}<br>
<br>
static StringRef getLineCommentIndentPrefix(StringRef Comment) {<br>
- static const char *const KnownPrefixes[] = { "///", "//", "//!" };<br>
+ static const char *const KnownPrefixes[] = {"///", "//", "//!"};<br>
StringRef LongestPrefix;<br>
for (StringRef KnownPrefix : KnownPrefixes) {<br>
if (Comment.startswith(KnownPrefix)) {<br>
@@ -239,9 +239,8 @@ void BreakableLineComment::replaceWhites<br>
/*Spaces=*/1);<br>
}<br>
<br>
-void<br>
-BreakableLineComment::replaceWhitespaceBefore(unsigned LineIndex,<br>
- WhitespaceManager &Whitespaces) {<br>
+void BreakableLineComment::replaceWhitespaceBefore(<br>
+ unsigned LineIndex, WhitespaceManager &Whitespaces) {<br>
if (OriginalPrefix != Prefix) {<br>
Whitespaces.replaceWhitespaceInToken(Tok, OriginalPrefix.size(), 0, "", "",<br>
/*InPPDirective=*/false,<br>
@@ -415,9 +414,8 @@ void BreakableBlockComment::replaceWhite<br>
/*Newlines=*/0, /*IndentLevel=*/0, /*Spaces=*/1);<br>
}<br>
<br>
-void<br>
-BreakableBlockComment::replaceWhitespaceBefore(unsigned LineIndex,<br>
- WhitespaceManager &Whitespaces) {<br>
+void BreakableBlockComment::replaceWhitespaceBefore(<br>
+ unsigned LineIndex, WhitespaceManager &Whitespaces) {<br>
if (LineIndex == 0)<br>
return;<br>
StringRef Prefix = Decoration;<br>
<br>
Modified: cfe/trunk/lib/Format/ContinuationIndenter.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Format_ContinuationIndenter.cpp-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=TyKLV3jzW8zNT76-xRp82Bk1aAK89d6UxhabvNMO6zk&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/ContinuationIndenter.cpp?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/ContinuationIndenter.cpp (original)<br>
+++ cfe/trunk/lib/Format/ContinuationIndenter.cpp Wed Jun 17 08:08:06 2015<br>
@@ -714,7 +714,7 @@ unsigned ContinuationIndenter::moveState<br>
if (Current.is(TT_ObjCStringLiteral) && State.StartOfStringLiteral == 0)<br>
State.StartOfStringLiteral = State.Column + 1;<br>
else if (!Current.isOneOf(tok::comment, tok::identifier, tok::hash) &&<br>
- !Current.isStringLiteral())<br>
+ !Current.isStringLiteral())<br>
State.StartOfStringLiteral = 0;<br>
<br>
State.Column += Current.ColumnWidth;<br>
@@ -892,7 +892,7 @@ void ContinuationIndenter::moveStatePast<br>
// be a line break within this call.<br>
for (const FormatToken *Tok = &Current;<br>
Tok && Tok != Current.MatchingParen; Tok = Tok->Next) {<br>
- if (Tok->MustBreakBefore ||<br>
+ if (Tok->MustBreakBefore ||<br>
(Tok->CanBreakBefore && Tok->NewlinesBefore > 0)) {<br>
BreakBeforeParameter = true;<br>
break;<br>
<br>
Modified: cfe/trunk/lib/Format/Format.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Format_Format.cpp-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=nM8vEfoZrbT9G9Jil1J6_ll1CKQA5wk2zEXZwQQIJVE&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/Format.cpp (original)<br>
+++ cfe/trunk/lib/Format/Format.cpp Wed Jun 17 08:08:06 2015<br>
@@ -174,7 +174,8 @@ template <> struct MappingTraits<FormatS<br>
IO.mapOptional("AlignEscapedNewlinesLeft", Style.AlignEscapedNewlinesLeft);<br>
IO.mapOptional("AlignOperands", Style.AlignOperands);<br>
IO.mapOptional("AlignTrailingComments", Style.AlignTrailingComments);<br>
- IO.mapOptional("AlignConsecutiveAssignments", Style.AlignConsecutiveAssignments);<br>
+ IO.mapOptional("AlignConsecutiveAssignments",<br>
+ Style.AlignConsecutiveAssignments);<br>
IO.mapOptional("AllowAllParametersOfDeclarationOnNextLine",<br>
Style.AllowAllParametersOfDeclarationOnNextLine);<br>
IO.mapOptional("AllowShortBlocksOnASingleLine",<br>
@@ -1258,7 +1259,8 @@ public:<br>
}<br>
<br>
tooling::Replacements format(SmallVectorImpl<AnnotatedLine *> &AnnotatedLines,<br>
- FormatTokenLexer &Tokens, bool *IncompleteFormat) {<br>
+ FormatTokenLexer &Tokens,<br>
+ bool *IncompleteFormat) {<br>
TokenAnnotator Annotator(Style, Tokens.getKeywords());<br>
for (unsigned i = 0, e = AnnotatedLines.size(); i != e; ++i) {<br>
Annotator.annotate(*AnnotatedLines[i]);<br>
@@ -1504,8 +1506,7 @@ tooling::Replacements reformat(const For<br>
<br>
tooling::Replacements reformat(const FormatStyle &Style, StringRef Code,<br>
ArrayRef<tooling::Range> Ranges,<br>
- StringRef FileName,<br>
- bool *IncompleteFormat) {<br>
+ StringRef FileName, bool *IncompleteFormat) {<br>
if (Style.DisableFormat)<br>
return tooling::Replacements();<br>
<br>
<br>
Modified: cfe/trunk/lib/Format/FormatToken.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Format_FormatToken.h-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=pT27mWG3QPS_9sCU82TBJTcwmvNJ1iYYBRkrlUlZhTs&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/FormatToken.h?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/FormatToken.h (original)<br>
+++ cfe/trunk/lib/Format/FormatToken.h Wed Jun 17 08:08:06 2015<br>
@@ -86,24 +86,12 @@ enum TokenType {<br>
};<br>
<br>
// Represents what type of block a set of braces open.<br>
-enum BraceBlockKind {<br>
- BK_Unknown,<br>
- BK_Block,<br>
- BK_BracedInit<br>
-};<br>
+enum BraceBlockKind { BK_Unknown, BK_Block, BK_BracedInit };<br>
<br>
// The packing kind of a function's parameters.<br>
-enum ParameterPackingKind {<br>
- PPK_BinPacked,<br>
- PPK_OnePerLine,<br>
- PPK_Inconclusive<br>
-};<br>
+enum ParameterPackingKind { PPK_BinPacked, PPK_OnePerLine, PPK_Inconclusive };<br>
<br>
-enum FormatDecision {<br>
- FD_Unformatted,<br>
- FD_Continue,<br>
- FD_Break<br>
-};<br>
+enum FormatDecision { FD_Unformatted, FD_Continue, FD_Break };<br>
<br>
class TokenRole;<br>
class AnnotatedLine;<br>
<br>
Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Format_TokenAnnotator.cpp-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=fLwPwmrRddaLLwf2OCRPwvn_6bGsUAsPz2sq8vMy900&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/TokenAnnotator.cpp (original)<br>
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp Wed Jun 17 08:08:06 2015<br>
@@ -1844,7 +1844,8 @@ bool TokenAnnotator::spaceRequiredBetwee<br>
tok::kw_new, tok::kw_delete) &&<br>
(!Left.Previous || Left.Previous->isNot(tok::period))))) ||<br>
(Style.SpaceBeforeParens == FormatStyle::SBPO_Always &&<br>
- (Left.is(tok::identifier) || Left.isFunctionLikeKeyword() || Left.is(tok::r_paren)) &&<br>
+ (Left.is(tok::identifier) || Left.isFunctionLikeKeyword() ||<br>
+ Left.is(tok::r_paren)) &&<br>
Line.Type != LT_PreprocessorDirective);<br>
}<br>
if (Left.is(tok::at) && Right.Tok.getObjCKeywordID() != tok::objc_not_keyword)<br>
@@ -2015,11 +2016,10 @@ bool TokenAnnotator::mustBreakBefore(con<br>
if (Right.is(tok::char_constant) && Left.is(tok::plus) && Left.Previous &&<br>
Left.Previous->is(tok::char_constant))<br>
return true;<br>
- if (Left.is(TT_DictLiteral) && Left.is(tok::l_brace) &&<br>
- Line.Level == 0 && Left.Previous &&<br>
- Left.Previous->is(tok::equal) &&<br>
- Line.First->isOneOf(tok::identifier, Keywords.kw_import,<br>
- tok::kw_export, tok::kw_const) &&<br>
+ if (Left.is(TT_DictLiteral) && Left.is(tok::l_brace) && Line.Level == 0 &&<br>
+ Left.Previous && Left.Previous->is(tok::equal) &&<br>
+ Line.First->isOneOf(tok::identifier, Keywords.kw_import, tok::kw_export,<br>
+ tok::kw_const) &&<br>
// kw_var is a pseudo-token that's a tok::identifier, so matches above.<br>
!Line.startsWith(Keywords.kw_var))<br>
// Object literals on the top level of a file are treated as "enum-style".<br>
@@ -2064,7 +2064,7 @@ bool TokenAnnotator::mustBreakBefore(con<br>
Left.isNot(TT_CtorInitializerColon) &&<br>
(Right.NewlinesBefore > 0 && Right.HasUnescapedNewline);<br>
if (Left.isTrailingComment())<br>
- return true;<br>
+ return true;<br>
if (Left.isStringLiteral() &&<br>
(Right.isStringLiteral() || Right.is(TT_ObjCStringLiteral)))<br>
return true;<br>
<br>
Modified: cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Format_UnwrappedLineFormatter.cpp-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=g2uKAf8_6crhHX5U97902mUoIU_Sm3Km7LSqSM0tLfY&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp (original)<br>
+++ cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp Wed Jun 17 08:08:06 2015<br>
@@ -445,9 +445,9 @@ private:<br>
<br>
const FormatStyle &Style;<br>
const AdditionalKeywords &Keywords;<br>
- const SmallVectorImpl<AnnotatedLine*>::const_iterator End;<br>
+ const SmallVectorImpl<AnnotatedLine *>::const_iterator End;<br>
<br>
- SmallVectorImpl<AnnotatedLine*>::const_iterator Next;<br>
+ SmallVectorImpl<AnnotatedLine *>::const_iterator Next;<br>
};<br>
<br>
static void markFinalized(FormatToken *Tok) {<br>
<br>
Modified: cfe/trunk/lib/Format/UnwrappedLineFormatter.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Format_UnwrappedLineFormatter.h-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=tRa1nKkG-pmsYnVn5Yhpj1axZ1dOBQYGWCbDPiPGJvU&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineFormatter.h?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/UnwrappedLineFormatter.h (original)<br>
+++ cfe/trunk/lib/Format/UnwrappedLineFormatter.h Wed Jun 17 08:08:06 2015<br>
@@ -52,7 +52,8 @@ private:<br>
<br>
/// \brief Returns the column limit for a line, taking into account whether we<br>
/// need an escaped newline due to a continued preprocessor directive.<br>
- unsigned getColumnLimit(bool InPPDirective, const AnnotatedLine *NextLine) const;<br>
+ unsigned getColumnLimit(bool InPPDirective,<br>
+ const AnnotatedLine *NextLine) const;<br>
<br>
// Cache to store the penalty of formatting a vector of AnnotatedLines<br>
// starting from a specific additional offset. Improves performance if there<br>
<br>
Modified: cfe/trunk/lib/Format/UnwrappedLineParser.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Format_UnwrappedLineParser.cpp-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=ZFZFilnEUf1iE-LecpYgy2gf5DDZS3zLWsUddwNNT6s&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineParser.cpp?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/UnwrappedLineParser.cpp (original)<br>
+++ cfe/trunk/lib/Format/UnwrappedLineParser.cpp Wed Jun 17 08:08:06 2015<br>
@@ -251,7 +251,6 @@ void UnwrappedLineParser::parse() {<br>
assert(PPLevelBranchIndex.back() <= PPLevelBranchCount.back());<br>
}<br>
} while (!PPLevelBranchIndex.empty());<br>
-<br>
}<br>
<br>
void UnwrappedLineParser::parseFile() {<br>
@@ -887,8 +886,7 @@ void UnwrappedLineParser::parseStructura<br>
? FormatTok->NewlinesBefore > 0<br>
: CommentsBeforeNextToken.front()->NewlinesBefore > 0;<br>
<br>
- if (FollowedByNewline &&<br>
- (Text.size() >= 5 || FunctionLike) &&<br>
+ if (FollowedByNewline && (Text.size() >= 5 || FunctionLike) &&<br>
tokenCanStartNewLine(FormatTok->Tok) && Text == Text.upper()) {<br>
addUnwrappedLine();<br>
return;<br>
@@ -1048,7 +1046,7 @@ void UnwrappedLineParser::tryToParseJSFu<br>
if (FormatTok->is(tok::l_brace))<br>
tryToParseBracedList();<br>
else<br>
- while(FormatTok->isNot(tok::l_brace) && !eof())<br>
+ while (FormatTok->isNot(tok::l_brace) && !eof())<br>
nextToken();<br>
}<br>
<br>
@@ -1081,7 +1079,7 @@ bool UnwrappedLineParser::parseBracedLis<br>
nextToken();<br>
// Fat arrows can be followed by simple expressions or by child blocks<br>
// in curly braces.<br>
- if (FormatTok->is(tok::l_brace)){<br>
+ if (FormatTok->is(tok::l_brace)) {<br>
parseChildBlock();<br>
continue;<br>
}<br>
@@ -1591,7 +1589,6 @@ void UnwrappedLineParser::parseRecord()<br>
const FormatToken &InitialToken = *FormatTok;<br>
nextToken();<br>
<br>
-<br>
// The actual identifier can be a nested name specifier, and in macros<br>
// it is often token-pasted.<br>
while (FormatTok->isOneOf(tok::identifier, tok::coloncolon, tok::hashhash,<br>
<br>
Modified: cfe/trunk/lib/Format/WhitespaceManager.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Format_WhitespaceManager.h-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=GNUc4FkQAQvU_bpvh_C2IXnqEYpiDXuz1BDvMEyoA58&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/WhitespaceManager.h?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/WhitespaceManager.h (original)<br>
+++ cfe/trunk/lib/Format/WhitespaceManager.h Wed Jun 17 08:08:06 2015<br>
@@ -167,9 +167,11 @@ private:<br>
/// \brief Align consecutive assignments over all \c Changes.<br>
void alignConsecutiveAssignments();<br>
<br>
- /// \brief Align consecutive assignments from change \p Start to change \p End at<br>
+ /// \brief Align consecutive assignments from change \p Start to change \p End<br>
+ /// at<br>
/// the specified \p Column.<br></blockquote><div><br></div></div></div><div>This change looks a bit strange.</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- void alignConsecutiveAssignments(unsigned Start, unsigned End, unsigned Column);<br>
+ void alignConsecutiveAssignments(unsigned Start, unsigned End,<br>
+ unsigned Column);<br>
<br>
/// \brief Align trailing comments over all \c Changes.<br>
void alignTrailingComments();<br>
<br>
Modified: cfe/trunk/unittests/Format/FormatTest.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_unittests_Format_FormatTest.cpp-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=Zp3j1_KpeB5u3tIrtZYkz-s6FH1rfN8FTFX3FjLlR28&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)<br>
+++ cfe/trunk/unittests/Format/FormatTest.cpp Wed Jun 17 08:08:06 2015<br>
@@ -150,8 +150,8 @@ TEST_F(FormatTest, OnlyGeneratesNecessar<br>
"\r\n"<br>
"*/\r\n",<br>
format("/*\r\n"<br>
- "\r\n"<br>
- "*/\r\n"));<br>
+ "\r\n"<br>
+ "*/\r\n"));<br>
EXPECT_EQ(0, ReplacementCount);<br>
}<br>
<br>
@@ -2664,7 +2664,8 @@ TEST_F(FormatTest, MacroDefinitionsWithI<br>
"#define b \\\n"<br>
" } \\\n"<br>
" a\n"<br>
- "a", getLLVMStyleWithColumns(15));<br>
+ "a",<br>
+ getLLVMStyleWithColumns(15));<br>
verifyFormat("#define A \\\n"<br>
" { \\\n"<br>
" {\n"<br>
@@ -2892,8 +2893,7 @@ TEST_F(FormatTest, EscapedNewlines) {<br>
EXPECT_EQ(<br>
"#define A \\\n int i; \\\n int j;",<br>
format("#define A \\\nint i;\\\n int j;", getLLVMStyleWithColumns(11)));<br>
- EXPECT_EQ(<br>
- "#define A\n\nint i;", format("#define A \\\n\n int i;"));<br>
+ EXPECT_EQ("#define A\n\nint i;", format("#define A \\\n\n int i;"));<br>
EXPECT_EQ("template <class T> f();", format("\\\ntemplate <class T> f();"));<br>
EXPECT_EQ("/* \\ \\ \\\n*/", format("\\\n/* \\ \\ \\\n*/"));<br>
EXPECT_EQ("<a\n\\\\\n>", format("<a\n\\\\\n>"));<br>
@@ -6115,20 +6115,19 @@ TEST_F(FormatTest, LayoutCxx11BraceIniti<br>
"std::this_thread::sleep_for(\n"<br>
" std::chrono::nanoseconds{ std::chrono::seconds{ 1 } } / 5);",<br>
ExtraSpaces);<br>
- verifyFormat(<br>
- "std::vector<MyValues> aaaaaaaaaaaaaaaaaaa{\n"<br>
- " aaaaaaa,\n"<br>
- " aaaaaaaaaa,\n"<br>
- " aaaaa,\n"<br>
- " aaaaaaaaaaaaaaa,\n"<br>
- " aaa,\n"<br>
- " aaaaaaaaaa,\n"<br>
- " a,\n"<br>
- " aaaaaaaaaaaaaaaaaaaaa,\n"<br>
- " aaaaaaaaaaaa,\n"<br>
- " aaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaa,\n"<br>
- " aaaaaaa,\n"<br>
- " a};");<br>
+ verifyFormat("std::vector<MyValues> aaaaaaaaaaaaaaaaaaa{\n"<br>
+ " aaaaaaa,\n"<br>
+ " aaaaaaaaaa,\n"<br>
+ " aaaaa,\n"<br>
+ " aaaaaaaaaaaaaaa,\n"<br>
+ " aaa,\n"<br>
+ " aaaaaaaaaa,\n"<br>
+ " a,\n"<br>
+ " aaaaaaaaaaaaaaaaaaaaa,\n"<br>
+ " aaaaaaaaaaaa,\n"<br>
+ " aaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaa,\n"<br>
+ " aaaaaaa,\n"<br>
+ " a};");<br>
verifyFormat("vector<int> foo = { ::SomeGlobalFunction() };", ExtraSpaces);<br>
}<br>
<br>
@@ -8945,13 +8944,15 @@ TEST_F(FormatTest, GetsCorrectBasedOnSty<br>
Styles[2].Language = FormatStyle::LK_JavaScript;<br>
EXPECT_EQ(0, parseConfiguration("Language: JavaScript\n"<br>
"BasedOnStyle: Google",<br>
- &Styles[2]).value());<br>
+ &Styles[2])<br>
+ .value());<br>
<br>
Styles[3] = getLLVMStyle();<br>
Styles[3].Language = FormatStyle::LK_JavaScript;<br>
EXPECT_EQ(0, parseConfiguration("BasedOnStyle: Google\n"<br>
"Language: JavaScript",<br>
- &Styles[3]).value());<br>
+ &Styles[3])<br>
+ .value());<br>
<br>
Styles[4] = getLLVMStyle();<br>
Styles[4].Language = FormatStyle::LK_JavaScript;<br>
@@ -8961,7 +8962,8 @@ TEST_F(FormatTest, GetsCorrectBasedOnSty<br>
"---\n"<br>
"BasedOnStyle: Google\n"<br>
"Language: JavaScript",<br>
- &Styles[4]).value());<br>
+ &Styles[4])<br>
+ .value());<br>
EXPECT_ALL_STYLES_EQUAL(Styles);<br>
}<br>
<br>
@@ -9260,7 +9262,8 @@ TEST_F(FormatTest, UsesLanguageForBasedO<br>
"Language: JavaScript\n"<br>
"IndentWidth: 76\n"<br>
"...\n",<br>
- &Style).value());<br>
+ &Style)<br>
+ .value());<br>
EXPECT_FALSE(Style.BreakBeforeTernaryOperators);<br>
EXPECT_EQ(76u, Style.IndentWidth);<br>
EXPECT_EQ(FormatStyle::LK_JavaScript, Style.Language);<br>
@@ -9933,8 +9936,7 @@ TEST_F(FormatTest, FormatsBlocksWithZero<br>
<br>
ZeroColumn.AllowShortBlocksOnASingleLine = true;<br>
EXPECT_EQ("void (^largeBlock)(void) = ^{ int i; };",<br>
- format("void (^largeBlock)(void) = ^{ int i; };",<br>
- ZeroColumn));<br>
+ format("void (^largeBlock)(void) = ^{ int i; };", ZeroColumn));<br>
ZeroColumn.AllowShortBlocksOnASingleLine = false;<br>
EXPECT_EQ("void (^largeBlock)(void) = ^{\n"<br>
" int i;\n"<br>
<br>
Modified: cfe/trunk/unittests/Format/FormatTestJS.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_unittests_Format_FormatTestJS.cpp-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=j0KlYHXeGH_TBzUrBRQs16ov1cK8uQ63rSduhgthqSw&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTestJS.cpp?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/unittests/Format/FormatTestJS.cpp (original)<br>
+++ cfe/trunk/unittests/Format/FormatTestJS.cpp Wed Jun 17 08:08:06 2015<br>
@@ -256,9 +256,8 @@ TEST_F(FormatTestJS, FormatsFreestanding<br>
}<br>
<br>
TEST_F(FormatTestJS, ArrayLiterals) {<br>
- verifyFormat(<br>
- "var aaaaa: List<SomeThing> =\n"<br>
- " [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];");<br>
+ verifyFormat("var aaaaa: List<SomeThing> =\n"<br>
+ " [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];");<br>
verifyFormat("return [\n"<br>
" aaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"<br>
" bbbbbbbbbbbbbbbbbbbbbbbbbbb,\n"<br>
@@ -856,9 +855,7 @@ TEST_F(FormatTestJS, TemplateStrings) {<br>
"var y;"));<br>
}<br>
<br>
-TEST_F(FormatTestJS, CastSyntax) {<br>
- verifyFormat("var x = <type>foo;");<br>
-}<br>
+TEST_F(FormatTestJS, CastSyntax) { verifyFormat("var x = <type>foo;"); }<br>
<br>
TEST_F(FormatTestJS, TypeArguments) {<br>
verifyFormat("class X<Y> {}");<br>
<br>
Modified: cfe/trunk/unittests/Format/FormatTestJava.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_unittests_Format_FormatTestJava.cpp-3Frev-3D239903-26r1-3D239902-26r2-3D239903-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=7KaKL5XYAk844h3Lsv9pj9arg5R-04dw_axD4YNarJ8&s=R1v1KqbKfJyuPN068wgXe5Knl4d7Wc_DgtVN8RGF_Tg&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTestJava.cpp?rev=239903&r1=239902&r2=239903&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/unittests/Format/FormatTestJava.cpp (original)<br>
+++ cfe/trunk/unittests/Format/FormatTestJava.cpp Wed Jun 17 08:08:06 2015<br>
@@ -31,9 +31,9 @@ protected:<br>
return Result;<br>
}<br>
<br>
- static std::string format(<br>
- llvm::StringRef Code,<br>
- const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_Java)) {<br>
+ static std::string<br>
+ format(llvm::StringRef Code,<br>
+ const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_Java)) {<br>
return format(Code, 0, Code.size(), Style);<br>
}<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>