[clang][AIX] add option mdefault-visibility-export-mapping
authorDavid Tenty <daltenty@ibm.com>
Tue, 10 May 2022 15:39:58 +0000 (11:39 -0400)
committerDavid Tenty <daltenty@ibm.com>
Wed, 1 Jun 2022 22:07:17 +0000 (18:07 -0400)
commit8c8a2679a20f621994fa904bcfc68775e7345edc
tree713ad05aca12c99f7c0f18d5c612acc1a1d49ccc
parent6232a8f3d61e5856c17e7b314385e9ea8068cdc1
[clang][AIX] add option mdefault-visibility-export-mapping

The option mdefault-visibility-export-mapping is created to allow
mapping default visibility to an explicit shared library export
(e.g. dllexport). Exactly how and if this is manifested is target
dependent (since it depends on how they map dllexport in the IR).

Three values are provided for the option:

* none: the default and behavior without the option, no additional export linkage information is created.
* explicit: add the export for entities with explict default visibility from the source, including RTTI
* all: add the export for all entities with default visibility

This option is useful for targets which do not export symbols as part of
their usual default linkage behaviour (e.g. AIX), such targets
traditionally specified such information in external files (e.g. export
lists), but this mapping allows them to use the visibility information
typically used for this purpose on other (e.g. ELF) platforms.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D126340
13 files changed:
clang/docs/UsersManual.rst
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Basic/LangOptions.h
clang/include/clang/Driver/Options.td
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/lib/CodeGen/ItaniumCXXABI.cpp
clang/lib/CodeGen/MicrosoftCXXABI.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/CodeGen/mdefault-visibility-export-mapping.c [new file with mode: 0644]
clang/test/CodeGenCXX/mdefault-visibility-export-mapping-alias.cpp [new file with mode: 0644]
clang/test/CodeGenCXX/mdefault-visibility-export-mapping-rtti.cpp [new file with mode: 0644]
clang/test/CodeGenCXX/mdefault-visibility-export-mapping.cpp [new file with mode: 0644]