diff options
author | Paul Hoad <mydeveloperday@gmail.com> | 2019-03-01 09:09:54 +0000 |
---|---|---|
committer | Paul Hoad <mydeveloperday@gmail.com> | 2019-03-01 09:09:54 +0000 |
commit | 70f886033a4637e1fb6e4b8ab1fad09a3dcca5a7 (patch) | |
tree | e5bea4b4787f454e90f27284a198a4de527c29ab /lib/Format/TokenAnnotator.cpp | |
parent | 90bacb6791239128c8169ad268ee45269a36d44f (diff) |
[clang-format] [NFC] clang-format the Format library
Previously revisions commited non-clang-formatted changes to the Format library, this means submitting any revision e.g. {D55170} can cause additional whitespace changes to potentially be included in a revision.
Commit a non functional change using latest build Windows clang-format r351376 with no other changes, to remove these differences
All FormatTests
pass [==========] 652 tests from 20 test cases ran.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/TokenAnnotator.cpp')
-rw-r--r-- | lib/Format/TokenAnnotator.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 9f4e1802a8..246ac781fd 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -61,7 +61,7 @@ private: if (NonTemplateLess.count(CurrentToken->Previous)) return false; - const FormatToken &Previous = *CurrentToken->Previous; // The '<'. + const FormatToken &Previous = *CurrentToken->Previous; // The '<'. if (Previous.Previous) { if (Previous.Previous->Tok.isLiteral()) return false; @@ -365,7 +365,7 @@ private: // specifier parameter, although this is technically valid: // [[foo(:)]] if (AttrTok->is(tok::colon) || - AttrTok->startsSequence(tok::identifier, tok::identifier) || + AttrTok->startsSequence(tok::identifier, tok::identifier) || AttrTok->startsSequence(tok::r_paren, tok::identifier)) return false; if (AttrTok->is(tok::ellipsis)) @@ -531,11 +531,11 @@ private: // Here, we set FirstObjCSelectorName when the end of the method call is // reached, in case it was not set already. if (!Contexts.back().FirstObjCSelectorName) { - FormatToken* Previous = CurrentToken->getPreviousNonComment(); - if (Previous && Previous->is(TT_SelectorName)) { - Previous->ObjCSelectorNameParts = 1; - Contexts.back().FirstObjCSelectorName = Previous; - } + FormatToken *Previous = CurrentToken->getPreviousNonComment(); + if (Previous && Previous->is(TT_SelectorName)) { + Previous->ObjCSelectorNameParts = 1; + Contexts.back().FirstObjCSelectorName = Previous; + } } else { Left->ParameterCount = Contexts.back().FirstObjCSelectorName->ObjCSelectorNameParts; @@ -1397,7 +1397,8 @@ private: Current.Type = Current.Previous->Type; } } else if (canBeObjCSelectorComponent(Current) && - // FIXME(bug 36976): ObjC return types shouldn't use TT_CastRParen. + // FIXME(bug 36976): ObjC return types shouldn't use + // TT_CastRParen. Current.Previous && Current.Previous->is(TT_CastRParen) && Current.Previous->MatchingParen && Current.Previous->MatchingParen->Previous && @@ -2423,9 +2424,9 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, if (Right.isOneOf(tok::semi, tok::comma)) return false; if (Right.is(tok::less) && Line.Type == LT_ObjCDecl) { - bool IsLightweightGeneric = - Right.MatchingParen && Right.MatchingParen->Next && - Right.MatchingParen->Next->is(tok::colon); + bool IsLightweightGeneric = Right.MatchingParen && + Right.MatchingParen->Next && + Right.MatchingParen->Next->is(tok::colon); return !IsLightweightGeneric && Style.ObjCSpaceBeforeProtocolList; } if (Right.is(tok::less) && Left.is(tok::kw_template)) @@ -2612,7 +2613,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, // Slashes occur in text protocol extension syntax: [type/type] { ... }. if (Left.is(tok::slash) || Right.is(tok::slash)) return false; - if (Left.MatchingParen && Left.MatchingParen->is(TT_ProtoExtensionLSquare) && + if (Left.MatchingParen && + Left.MatchingParen->is(TT_ProtoExtensionLSquare) && Right.isOneOf(tok::l_brace, tok::less)) return !Style.Cpp11BracedListStyle; // A percent is probably part of a formatting specification, such as %lld. @@ -3129,7 +3131,7 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line, // function f(): a is B { ... } // Do not break before is in these cases. if (Right.is(Keywords.kw_is)) { - const FormatToken* Next = Right.getNextNonComment(); + const FormatToken *Next = Right.getNextNonComment(); // If `is` is followed by a colon, it's likely that it's a dict key, so // ignore it for this check. // For example this is common in Polymer: |