Branch: refs/heads/main
Revision: 044c1bbe5881b55955609e9deb33f60d798fb8e1
Author: DanilaFe
Link: Dyno: ensure lookup traces match ids by DanilaFe · Pull Request #28619 · chapel-lang/chapel · GitHub
Log Message:
Dyno: ensure lookup traces match ids (#28619)
I had this change laying around on an unrelated branch. Most of the
large diff is due to moving the MatchingIds type to a different point
in the file.
Code in Dyno today assumes that the vector of traces (which describe how
an identifier was found) is a one-to-one mapping with the list of found
IDs. This used to be the case, but is not the case anymore, now that we
deduplicate found IDs. In this PR, adjust the deduplication to also drop
/ reorder traces to match the order of IDs, once again restoring the
assumption.
As far as I can tell, it's not possible to trigger issues due to this
change on main today, because code that can produce duplicate IDs
(typically via cached public symbol lists) does not run when tracing is
enabled. However, I still think it makes sense to fix this issue, in
case assumptions change once again or duplication becomes possible in
other ways.
Reviewed by @arifthpe -- thanks!
Testing
- dyno tests
- paratest
Diff:
M frontend/include/chpl/resolution/scope-types.h
M frontend/lib/resolution/scope-queries.cpp
M frontend/lib/resolution/scope-types.cpp
https://github.com/chapel-lang/chapel/pull/28619.diff