Commit 03bf349
committed
[Macros] Improve visitation of auxiliary decls
Use the same pattern as 'getAllMembers()'. This supports nested macro
expansion:
```
std::function<void(Decl *)> visit;
visit = [&](Decl *d) {
doIt(d);
d->visitAuxiliaryDecls(visit);
};
for (auto *d : decls)
visit(d);
```
Don't visit auxiliary decls in `PrintAST::visit(Decl *)` this function
is only intended for single decl printing. The caller should visit them
separately. For that, add
`ModuleDecl::getTopLevelDeclsWithAuxiliaryDecls()`1 parent 6f5283e commit 03bf349
File tree
5 files changed
+33
-21
lines changed- include/swift/AST
- lib
- AST
- Frontend
5 files changed
+33
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
967 | 967 | | |
968 | 968 | | |
969 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
970 | 974 | | |
971 | 975 | | |
972 | 976 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | 1038 | | |
1045 | 1039 | | |
1046 | 1040 | | |
| |||
4510 | 4504 | | |
4511 | 4505 | | |
4512 | 4506 | | |
| 4507 | + | |
| 4508 | + | |
| 4509 | + | |
| 4510 | + | |
| 4511 | + | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
4513 | 4515 | | |
4514 | 4516 | | |
4515 | 4517 | | |
4516 | 4518 | | |
4517 | 4519 | | |
4518 | | - | |
4519 | | - | |
| 4520 | + | |
4520 | 4521 | | |
4521 | 4522 | | |
4522 | 4523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1331 | 1331 | | |
1332 | 1332 | | |
1333 | 1333 | | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
1334 | 1339 | | |
1335 | 1340 | | |
1336 | 1341 | | |
| |||
3095 | 3100 | | |
3096 | 3101 | | |
3097 | 3102 | | |
3098 | | - | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
3099 | 3106 | | |
3100 | 3107 | | |
3101 | 3108 | | |
| |||
4190 | 4197 | | |
4191 | 4198 | | |
4192 | 4199 | | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
4193 | 4207 | | |
4194 | 4208 | | |
4195 | 4209 | | |
4196 | 4210 | | |
4197 | | - | |
4198 | | - | |
4199 | | - | |
4200 | | - | |
| 4211 | + | |
4201 | 4212 | | |
4202 | 4213 | | |
4203 | 4214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4005 | 4005 | | |
4006 | 4006 | | |
4007 | 4007 | | |
4008 | | - | |
| 4008 | + | |
| 4009 | + | |
4009 | 4010 | | |
4010 | 4011 | | |
4011 | | - | |
4012 | | - | |
4013 | | - | |
4014 | | - | |
4015 | | - | |
| 4012 | + | |
4016 | 4013 | | |
4017 | | - | |
4018 | 4014 | | |
4019 | 4015 | | |
4020 | 4016 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
836 | | - | |
| 836 | + | |
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| |||
0 commit comments