Imported functions and variables get the visibility from the prevailing
module. However, non-prevailing and prevailing definitions do not get
the visibility from the most constraining visibility among all modules.
This patch
* adds visibility bits to GlobalValueSummary::GVFlags
* (for ELF) computes the most constraining visibility among all definitions and propagates it to all definitions
Protected/hidden can imply dso_local which can enable some optimizations (this
is stronger than GVFlags::DSOLocal because the implied dso_local can be
leveraged for ELF -shared while default visibility dso_local has to be cleared
for ELF -shared).
Note: the visibility from a declaration is not tracked, so if a declaration has
the most constraining visibility, the result visibility may not be that one.