diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-10 19:25:56 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-10 19:25:56 +0900 |
commit | 63f5dc16d6bfca0512fb034052b41d13c3751e20 (patch) | |
tree | e70266be1fda941e0974e71e3d2c1cf080081311 /clang/lib/Format/TokenAnnotator.cpp | |
parent | 9e5734688ed3d5f6b3fb76a26b3d90a736d60781 (diff) | |
parent | 397ac44f623f891d8f05d6673a95984ac0a26671 (diff) | |
download | llvm-users/chapuni/cov/single/unify.zip llvm-users/chapuni/cov/single/unify.tar.gz llvm-users/chapuni/cov/single/unify.tar.bz2 |
Merge branch 'main' into users/chapuni/cov/single/unifyusers/chapuni/cov/single/unify
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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 && |