NoQ created this revision. NoQ added reviewers: alexfh, gribozavr2, aaron.ballman, xazax.hun, vsavchenko. Herald added subscribers: martong, rnkovacs. NoQ requested review of this revision.
Isolated from D102213 <https://reviews.llvm.org/D102213>. No functional change intended. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D102303 Files: clang/docs/LibASTMatchersReference.html clang/include/clang/ASTMatchers/ASTMatchers.h Index: clang/include/clang/ASTMatchers/ASTMatchers.h =================================================================== --- clang/include/clang/ASTMatchers/ASTMatchers.h +++ clang/include/clang/ASTMatchers/ASTMatchers.h @@ -7543,7 +7543,7 @@ }); } -/// Matches declaration of the function the statement belongs to +/// Matches declaration of the function the statement belongs to. /// /// Given: /// \code @@ -7560,20 +7560,20 @@ const auto &Parents = Finder->getASTContext().getParents(Node); llvm::SmallVector<DynTypedNode, 8> Stack(Parents.begin(), Parents.end()); - while(!Stack.empty()) { + while (!Stack.empty()) { const auto &CurNode = Stack.back(); Stack.pop_back(); - if(const auto *FuncDeclNode = CurNode.get<FunctionDecl>()) { - if(InnerMatcher.matches(*FuncDeclNode, Finder, Builder)) { + if (const auto *FuncDeclNode = CurNode.get<FunctionDecl>()) { + if (InnerMatcher.matches(*FuncDeclNode, Finder, Builder)) { return true; } - } else if(const auto *LambdaExprNode = CurNode.get<LambdaExpr>()) { - if(InnerMatcher.matches(*LambdaExprNode->getCallOperator(), - Finder, Builder)) { + } else if (const auto *LambdaExprNode = CurNode.get<LambdaExpr>()) { + if (InnerMatcher.matches(*LambdaExprNode->getCallOperator(), Finder, + Builder)) { return true; } } else { - for(const auto &Parent: Finder->getASTContext().getParents(CurNode)) + for (const auto &Parent : Finder->getASTContext().getParents(CurNode)) Stack.push_back(Parent); } } Index: clang/docs/LibASTMatchersReference.html =================================================================== --- clang/docs/LibASTMatchersReference.html +++ clang/docs/LibASTMatchersReference.html @@ -8814,7 +8814,7 @@ <tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('forFunction0')"><a name="forFunction0Anchor">forFunction</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>> InnerMatcher</td></tr> -<tr><td colspan="4" class="doc" id="forFunction0"><pre>Matches declaration of the function the statement belongs to +<tr><td colspan="4" class="doc" id="forFunction0"><pre>Matches declaration of the function the statement belongs to. Given: F& operator=(const F& o) {
Index: clang/include/clang/ASTMatchers/ASTMatchers.h =================================================================== --- clang/include/clang/ASTMatchers/ASTMatchers.h +++ clang/include/clang/ASTMatchers/ASTMatchers.h @@ -7543,7 +7543,7 @@ }); } -/// Matches declaration of the function the statement belongs to +/// Matches declaration of the function the statement belongs to. /// /// Given: /// \code @@ -7560,20 +7560,20 @@ const auto &Parents = Finder->getASTContext().getParents(Node); llvm::SmallVector<DynTypedNode, 8> Stack(Parents.begin(), Parents.end()); - while(!Stack.empty()) { + while (!Stack.empty()) { const auto &CurNode = Stack.back(); Stack.pop_back(); - if(const auto *FuncDeclNode = CurNode.get<FunctionDecl>()) { - if(InnerMatcher.matches(*FuncDeclNode, Finder, Builder)) { + if (const auto *FuncDeclNode = CurNode.get<FunctionDecl>()) { + if (InnerMatcher.matches(*FuncDeclNode, Finder, Builder)) { return true; } - } else if(const auto *LambdaExprNode = CurNode.get<LambdaExpr>()) { - if(InnerMatcher.matches(*LambdaExprNode->getCallOperator(), - Finder, Builder)) { + } else if (const auto *LambdaExprNode = CurNode.get<LambdaExpr>()) { + if (InnerMatcher.matches(*LambdaExprNode->getCallOperator(), Finder, + Builder)) { return true; } } else { - for(const auto &Parent: Finder->getASTContext().getParents(CurNode)) + for (const auto &Parent : Finder->getASTContext().getParents(CurNode)) Stack.push_back(Parent); } } Index: clang/docs/LibASTMatchersReference.html =================================================================== --- clang/docs/LibASTMatchersReference.html +++ clang/docs/LibASTMatchersReference.html @@ -8814,7 +8814,7 @@ <tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('forFunction0')"><a name="forFunction0Anchor">forFunction</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>> InnerMatcher</td></tr> -<tr><td colspan="4" class="doc" id="forFunction0"><pre>Matches declaration of the function the statement belongs to +<tr><td colspan="4" class="doc" id="forFunction0"><pre>Matches declaration of the function the statement belongs to. Given: F& operator=(const F& o) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits