github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp --
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.cpp
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.h
clang-tools-extra/test/clang-tidy/checkers/misc/scope-reduction.cpp
clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.cpp
b/clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.cpp
index a959b8367..b1a462776 100644
--- a/clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.cpp
@@ -39,20 +39,22 @@
// declaration while still encompassing all it's uses.
#include "ScopeReductionCheck.h"
-#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "../utils/DeclRefExprUtils.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
using namespace clang::ast_matchers;
namespace clang::tidy::misc {
-static void collectVariableUses(const clang::Stmt *S, const clang::VarDecl
*Var,
- llvm::SmallVector<const clang::DeclRefExpr *,
8> &Uses) {
+static void
+collectVariableUses(const clang::Stmt *S, const clang::VarDecl *Var,
+ llvm::SmallVector<const clang::DeclRefExpr *, 8> &Uses) {
if (!S || !Var)
return;
llvm::SmallPtrSet<const clang::DeclRefExpr *, 16> DREs =
- clang::tidy::utils::decl_ref_expr::allDeclRefExprs(*Var, *S,
Var->getASTContext());
+ clang::tidy::utils::decl_ref_expr::allDeclRefExprs(*Var, *S,
+ Var->getASTContext());
// Copy the results into the provided SmallVector
Uses.clear();
@@ -64,7 +66,9 @@ void ScopeReductionCheck::registerMatchers(MatchFinder
*Finder) {
// to simplify check code.
// Match on varDecls that are part of a function
- Finder->addMatcher(varDecl(hasLocalStorage(),
hasAncestor(functionDecl())).bind("var"), this);
+ Finder->addMatcher(
+ varDecl(hasLocalStorage(), hasAncestor(functionDecl())).bind("var"),
+ this);
}
void ScopeReductionCheck::check(
``````````
</details>
https://github.com/llvm/llvm-project/pull/175429
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits