[all-commits] [llvm/llvm-project] 350493: [C++20] [Modules] Don't create multiple global mod...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Mon Feb 7 19:53:00 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3504937dfb2b7d90b2c3b3c7b28c472d31489007
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2022-02-08 (Tue, 08 Feb 2022)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaModule.cpp
    A clang/test/CXX/module/module.unit/p7/Inputs/h8.h
    A clang/test/CXX/module/module.unit/p7/Inputs/m8.cppm
    A clang/test/CXX/module/module.unit/p7/t8.cpp

  Log Message:
  [C++20] [Modules] Don't create multiple global module fragment

Since the serialization code would recognize modules by names and the
name of all global module fragment is <global>, so that the
serialization code would complain for the same module.

This patch fixes this by using a unique global module fragment in Sema.
Before this patch, the compiler would fail on an assertion complaining
the duplicated modules.

Reviewed By: urnathan, rsmith

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

More information about the All-commits mailing list