[Clang][-fvisibility-from-dllstorageclass] Set DSO Locality from final…

Authored by Ben Dunbobbin <Ben.Dunbobbin@sony.com> on Nov 23 2020, 1:27 AM.


[Clang][-fvisibility-from-dllstorageclass] Set DSO Locality from final visibility

Ensure that the DSO Locality of the globals in the IR is derived from
their final visibility when using -fvisibility-from-dllstorageclass.

To accomplish this we reset the DSO locality of globals (before
setting their visibility from their dllstorageclass) at the end of
IRGen in Clang. This removes any effects that visibility options or
annotations may have had on the DSO locality.

The resulting DSO locality of the globals will be pessimistic
w.r.t. to the normal compiler IRGen.

Differential Revision: https://reviews.llvm.org/D91779