Commit d4fd32d
committed
Register every cloned primal decl for reference remapping. NFC
BuildParams and DifferentiateVarDecl recorded a cloned parameter or local
in m_DeclReplacements only in the awkward cases -- a nameless parameter,
or a local whose clone was renamed or retyped -- and left every same-named
decl to be rebound by the scope-dependent Sema::LookupName fallback in
ReferencesUpdater. That name lookup is what couples cloning to the current
scope and blocks cloning a reference lazily.
Register the replacement for every primal parameter and local, so cloned
references rebind by explicit map lookup. A suite-wide census shows the
map and the name lookup never disagree, so this is behavior-preserving; it
empties the fallback census in reverse mode, a step toward retiring the
scope-dependent lookup entirely.1 parent 6c842f0 commit d4fd32d
2 files changed
Lines changed: 18 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | | - | |
341 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3336 | 3336 | | |
3337 | 3337 | | |
3338 | 3338 | | |
3339 | | - | |
3340 | | - | |
3341 | | - | |
3342 | | - | |
3343 | | - | |
3344 | | - | |
3345 | | - | |
3346 | | - | |
3347 | | - | |
3348 | | - | |
3349 | | - | |
3350 | | - | |
3351 | | - | |
3352 | | - | |
3353 | | - | |
3354 | | - | |
3355 | | - | |
3356 | | - | |
3357 | | - | |
3358 | | - | |
3359 | | - | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
3360 | 3348 | | |
3361 | 3349 | | |
3362 | 3350 | | |
| |||
5043 | 5031 | | |
5044 | 5032 | | |
5045 | 5033 | | |
5046 | | - | |
5047 | | - | |
| 5034 | + | |
| 5035 | + | |
| 5036 | + | |
| 5037 | + | |
| 5038 | + | |
5048 | 5039 | | |
5049 | 5040 | | |
5050 | 5041 | | |
| |||
0 commit comments