Files
swift-mirror/lib
David Farler 6f806b418f Compare top-level modules when deciding visibility for redeclarations
When importing C declarations, one can come across a redeclaration due
to two different clang modules textually including the same header.

Previously, to decide visibility of a declaration from a particular
module, the module in which it is redeclarated had to exactly match the
one we saw before, so a struct defined in A.B.C might cause it to be
hidden in A.X.Y, because we were already popping off submodule names on
the "left hand side", so the module comparison was A != A.X.Y. If
someone imports A.X.Y and expects that struct, they won't see it.

Now, strip off submodules of the "right hand side", correctly comparing
if the top-level modules match (A == A).

This may have the effect of allowing more declarations to be visible
than before but it prevents weird situations where struct typedefs can
be hidden in overly complicated nested header includes normally found in
OS system headers.

rdar://problem/23588593
2015-11-30 15:03:41 -08:00
..