Skip to content

Commit 32ebfed

Browse files
committed
format
1 parent b48a1f7 commit 32ebfed

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

clang-tools-extra/clang-tidy/performance/LostStdMoveCheck.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ void LostStdMoveCheck::registerMatchers(MatchFinder *Finder) {
2525
hasParent(expr(hasParent(cxxConstructExpr(hasParent(returnStmt())))));
2626

2727
auto outermostExpr = expr(unless(hasParent(expr())));
28-
auto leafStatement = stmt(outermostExpr, unless(hasDescendant(outermostExpr)));
28+
auto leafStatement =
29+
stmt(outermostExpr, unless(hasDescendant(outermostExpr)));
2930

3031
Finder->addMatcher(
3132
declRefExpr(
@@ -49,7 +50,7 @@ void LostStdMoveCheck::registerMatchers(MatchFinder *Finder) {
4950
unless(hasDeclaration(
5051
varDecl(hasType(qualType(lValueReferenceType()))))),
5152

52-
hasAncestor(leafStatement.bind("leaf_statement")),
53+
hasAncestor(leafStatement.bind("leaf_statement")),
5354

5455
hasDeclaration(
5556
varDecl(hasAncestor(functionDecl().bind("func"))).bind("decl")),
@@ -88,7 +89,8 @@ void LostStdMoveCheck::check(const MatchFinder::MatchResult &Result) {
8889
const auto *MatchedFunc = Result.Nodes.getNodeAs<FunctionDecl>("func");
8990
const auto *MatchedUse = Result.Nodes.getNodeAs<Expr>("use");
9091
const auto *MatchedUseCall = Result.Nodes.getNodeAs<CallExpr>("use_parent");
91-
const auto *MatchedLeafStatement = Result.Nodes.getNodeAs<Stmt>("leaf_statement");
92+
const auto *MatchedLeafStatement =
93+
Result.Nodes.getNodeAs<Stmt>("leaf_statement");
9294

9395
if (MatchedUseCall)
9496
return;
@@ -105,7 +107,9 @@ void LostStdMoveCheck::check(const MatchFinder::MatchResult &Result) {
105107

106108
// Calculate X usage count in the statement
107109
llvm::SmallPtrSet<const DeclRefExpr *, 16> DeclRefs;
108-
auto Matches = match(findAll(declRefExpr(to(varDecl(equalsNode(MatchedDecl)))).bind("ref")), *MatchedLeafStatement, *Result.Context);
110+
auto Matches = match(
111+
findAll(declRefExpr(to(varDecl(equalsNode(MatchedDecl)))).bind("ref")),
112+
*MatchedLeafStatement, *Result.Context);
109113
extractNodesByIdTo(Matches, "ref", DeclRefs);
110114
if (DeclRefs.size() > 1) {
111115
// Unspecified order of evaluation, e.g. f(x, x)

0 commit comments

Comments
 (0)