[all-commits] [llvm/llvm-project] 6a8673: Reland [clang][AIX] add option mdefault-visibility...

Nico Weber via All-commits all-commits at lists.llvm.org
Mon Jun 13 10:47:12 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6a8673038b0c7e20962d732515cd2cd4812f52ef
      https://github.com/llvm/llvm-project/commit/6a8673038b0c7e20962d732515cd2cd4812f52ef
  Author: David Tenty <daltenty at ibm.com>
  Date:   2022-06-13 (Mon, 13 Jun 2022)

  Changed paths:
    M clang/docs/UsersManual.rst
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/Basic/LangOptions.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/CodeGen/ItaniumCXXABI.cpp
    M clang/lib/CodeGen/MicrosoftCXXABI.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    A clang/test/CodeGen/mdefault-visibility-export-mapping.c
    A clang/test/CodeGenCXX/mdefault-visibility-export-mapping-alias.cpp
    A clang/test/CodeGenCXX/mdefault-visibility-export-mapping-rtti.cpp
    A clang/test/CodeGenCXX/mdefault-visibility-export-mapping.cpp

  Log Message:
  -----------
  Reland [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.

This relands commit: 8c8a2679a20f621994fa904bcfc68775e7345edc

with fixes for the compile time and assert problems that were reported
by:

* making shouldMapVisibilityToDLLExport inline and provide an early return
in the case where no mapping is in effect (aka non-AIX platforms)
* don't try to export RTTI types which we will give internal linkage to

Reviewed By: MaskRay

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


  Commit: 8c974bfe1cb944a760d3b838aec4179577d0c3f5
      https://github.com/llvm/llvm-project/commit/8c974bfe1cb944a760d3b838aec4179577d0c3f5
  Author: Nico Weber <thakis at chromium.org>
  Date:   2022-06-13 (Mon, 13 Jun 2022)

  Changed paths:
    M clang/include/clang/Serialization/ASTBitCodes.h

  Log Message:
  -----------
  Reland: unbreak Modules/cxx20-export-import.cpp with LLVM_APPEND_VC_REV after 8c8a2679a20f

See revision b8b7a9dcdcbc for prior art.

Reland of: 4463bd0f89181234e0cef982e21de2e96038f873 since the dependent
patch D126340 is also relanding.


Compare: https://github.com/llvm/llvm-project/compare/166d6ed5c70a...8c974bfe1cb9


More information about the All-commits mailing list