diff options
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/MatchFilePath.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 10 | ||||
-rw-r--r-- | clang/lib/Format/TokenAnnotator.h | 4 |
3 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/Format/MatchFilePath.cpp b/clang/lib/Format/MatchFilePath.cpp index 3d86148..1f1e4bf 100644 --- a/clang/lib/Format/MatchFilePath.cpp +++ b/clang/lib/Format/MatchFilePath.cpp @@ -63,10 +63,10 @@ bool matchFilePath(StringRef Pattern, StringRef FilePath) { if (I == EOP) // `Pattern` ends with a star. return Globstar || NoMoreSeparatorsInFilePath; if (Pattern[I] != Separator) { - Globstar = false; // `Pattern` ends with a lone backslash. if (Pattern[I] == '\\' && ++I == EOP) return false; + Globstar = false; } // The star is followed by a (possibly escaped) `Separator`. if (Pattern[I] == Separator) { diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index e18e9a6..bf5ee28 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -137,8 +137,6 @@ public: private: ScopeType getScopeType(const FormatToken &Token) const { switch (Token.getType()) { - case TT_LambdaLBrace: - return ST_ChildBlock; case TT_ClassLBrace: case TT_StructLBrace: case TT_UnionLBrace: @@ -3395,13 +3393,13 @@ private: /// Parse unary operator expressions and surround them with fake /// parentheses if appropriate. void parseUnaryOperator() { - llvm::SmallVector<FormatToken *, 2> Tokens; + SmallVector<FormatToken *, 2> Tokens; while (Current && Current->is(TT_UnaryOperator)) { Tokens.push_back(Current); next(); } parse(PrecedenceArrowAndPeriod); - for (FormatToken *Token : llvm::reverse(Tokens)) { + for (FormatToken *Token : reverse(Tokens)) { // The actual precedence doesn't matter. addFakeParenthesis(Token, prec::Unknown); } @@ -3579,7 +3577,7 @@ private: void TokenAnnotator::setCommentLineLevels( SmallVectorImpl<AnnotatedLine *> &Lines) const { const AnnotatedLine *NextNonCommentLine = nullptr; - for (AnnotatedLine *Line : llvm::reverse(Lines)) { + for (AnnotatedLine *Line : reverse(Lines)) { assert(Line->First); // If the comment is currently aligned with the line immediately following @@ -3700,7 +3698,7 @@ void TokenAnnotator::annotate(AnnotatedLine &Line) { Line.Type = Parser.parseLine(); if (!Line.Children.empty()) { - ScopeStack.push_back(ST_ChildBlock); + ScopeStack.push_back(ST_Other); const bool InRequiresExpression = Line.Type == LT_RequiresExpression; for (auto &Child : Line.Children) { if (InRequiresExpression && diff --git a/clang/lib/Format/TokenAnnotator.h b/clang/lib/Format/TokenAnnotator.h index fa15517..16e920e 100644 --- a/clang/lib/Format/TokenAnnotator.h +++ b/clang/lib/Format/TokenAnnotator.h @@ -38,13 +38,11 @@ enum LineType { }; enum ScopeType { - // Contained in child block. - ST_ChildBlock, // Contained in class declaration/definition. ST_Class, // Contained in compound requirement. ST_CompoundRequirement, - // Contained within other scope block (function, loop, if/else, etc). + // Contained in other blocks (function, lambda, loop, if/else, child, etc). ST_Other, }; |