Fixes multiple crashes where a non-canonical decl would be used as
key.
Details
Diff Detail
Event Timeline
I'm curious how this was failing -- all four places you changed appear to be walking over the method declarations that are lexically within the class definitions, so they should all see the same set of declarations. Is there some other source of map keys that uses the canonical declaration instead? In any case, using the canonical declaration as the key seems like a good idea.
Is there any reason not to put all the module definitions in the same module map file in your test case? The use directives also seem redundant, since this isn't a test of -fmodules-decluse.
Most of the code already uses the canonical decls. When we create the OverridersMap / MethodInfoMap we apparently already use the canonical decl as key. The problem is that when we walk over the methods of a class owned by one module ('b' in this test), we might hit methods whose canonical decl is the method from the other module ('c' in this case).
Is there any reason not to put all the module definitions in the same module map file in your test case? The use directives also seem redundant, since this isn't a test of -fmodules-decluse.
Done. Was just the way I was used to seeing module maps :)