[all-commits] [llvm/llvm-project] c7ed65: [C++20][Modules] Limit ModuleInternalLinkage to mo...

iains via All-commits all-commits at lists.llvm.org
Fri Apr 1 01:11:14 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c7ed65b4bcbd8c26704efc4193243831e3c13d3c
      https://github.com/llvm/llvm-project/commit/c7ed65b4bcbd8c26704efc4193243831e3c13d3c
  Author: Iain Sandoe <iain at sandoe.co.uk>
  Date:   2022-04-01 (Fri, 01 Apr 2022)

  Changed paths:
    M clang/lib/AST/Decl.cpp
    M clang/unittests/AST/DeclTest.cpp

  Log Message:
  -----------
  [C++20][Modules] Limit ModuleInternalLinkage to modules-ts.

At present, we are generating wrong code for C++20 modules entities which
should have internal linkage.  This is because we are assigning
'ModuleInternalLinkage' unconditionally to such entities.  However this mode
is only applicable to the modules-ts.

This change makes the special linkage mode conditional on fmodules-ts and
adds a unit test to verify that we generate the correct linkage.

Currently, static variables and functions in module purview are emitted into
object files as external. On some platforms, lambdas are emitted as global
weak defintions (on Windows this causes a mangler crash).

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




More information about the All-commits mailing list