File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,22 @@ static bool matchNVarDeclStartingWith(
44
44
const DeclStmt *EndDS = nullptr ;
45
45
size_t N = InnerMatchers.size ();
46
46
size_t Count = 0 ;
47
+
48
+ auto Matches = [&](const Decl *VD) {
49
+ // We don't want redundant decls in DeclStmt.
50
+ if (Count == N)
51
+ return false ;
52
+
53
+ if (const auto *Var = dyn_cast<VarDecl>(VD);
54
+ Var && InnerMatchers[Backwards ? N - Count - 1 : Count].matches (
55
+ *Var, Finder, Builder)) {
56
+ ++Count;
57
+ return true ;
58
+ }
59
+
60
+ return false ;
61
+ };
62
+
47
63
for (; Iter != EndIter; ++Iter) {
48
64
EndDS = dyn_cast<DeclStmt>(*Iter);
49
65
if (!EndDS)
@@ -52,21 +68,6 @@ static bool matchNVarDeclStartingWith(
52
68
if (!BeginDS)
53
69
BeginDS = EndDS;
54
70
55
- auto Matches = [&](const Decl *VD) {
56
- // We don't want redundant decls in DeclStmt.
57
- if (Count == N)
58
- return false ;
59
-
60
- if (const auto *Var = dyn_cast<VarDecl>(VD);
61
- Var && InnerMatchers[Backwards ? N - Count - 1 : Count].matches (
62
- *Var, Finder, Builder)) {
63
- ++Count;
64
- return true ;
65
- }
66
-
67
- return false ;
68
- };
69
-
70
71
if (Backwards) {
71
72
for (const auto *VD : llvm::reverse (EndDS->decls ())) {
72
73
if (!Matches (VD))
You can’t perform that action at this time.
0 commit comments