[all-commits] [llvm/llvm-project] c6e982: [C++20][Modules] Introduce an implementation module.

Iain Sandoe via All-commits all-commits at lists.llvm.org
Thu Mar 23 05:48:15 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c6e9823724ef6bdfee262289ee34d162db436af0
      https://github.com/llvm/llvm-project/commit/c6e9823724ef6bdfee262289ee34d162db436af0
  Author: Iain Sandoe <iain at sandoe.co.uk>
  Date:   2023-03-23 (Thu, 23 Mar 2023)

  Changed paths:
    M clang/include/clang/Basic/Module.h
    M clang/include/clang/Lex/ModuleMap.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/Decl.cpp
    M clang/lib/CodeGen/CGDeclCXX.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/Frontend/FrontendActions.cpp
    M clang/lib/Lex/ModuleMap.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaModule.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/test/CXX/module/basic/basic.def.odr/p4.cppm
    M clang/test/CXX/module/basic/basic.link/p2.cppm
    M clang/test/CodeGenCXX/module-intializer.cpp

  Log Message:
  -----------
  [C++20][Modules] Introduce an implementation module.

We need to be able to distinguish individual TUs from the same module in cases
where TU-local entities either need to be hidden (or, for some cases of ADL in
template instantiation, need to be detected as exposures).

This creates a module type for the implementation which implicitly imports its
primary module interface per C++20:
[module.unit/8] 'A module-declaration that contains neither an export-keyword
nor a module-partition implicitly imports the primary module interface unit of
the module as if by a module-import-declaration.

Implementation modules are never serialized (-emit-module-interface for an
implementation unit is diagnosed and rejected).

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




More information about the All-commits mailing list