You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a couple of passes of optimizing get_declaration_of to make its traversal of the symbol table more efficient, I decided to rewrite it entirely to build the information during the initial visitation and not scour at the symbol table afterwards to rediscover the information.
The code generation for all `*.cpp2` and `*.h2` files in the project is unchanged, so it seems likely that this rewrite is not introducing bugs. If we do find some, they should be easier to fix as the lookup logic is now more direct and built and consumed in just two places.
To prevent accidental behavior change, I exhaustively checked every call to get_declaration_of to check whether it returned a different result before and after this change. There were quite a few during debugging which pointed out where I'd overlooked a lookup case, and those are now all fixed. There remained only a few (<10) calls in this entire corpus where g_d_o is now giving a different result, but all are cases where g_d_o was not being consistent previously (repeated calls with the same arguments in the same execution sometimes gave a result and sometimes gave null) and it's now giving the same answer consistently that it gave "sometimes" before. So I think this change is fixing those as (latent) bugs... latent because the compilation output before/after is unchanged, because the previous inconsistency was in cases that didn't actually affect compilation behavior.
0 commit comments