[all-commits] [llvm/llvm-project] 279c7a: Revert "[C++20] [Modules] Don't load declaration e...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Tue Mar 28 20:16:08 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 279c7a2f17937836ed13e359c3fb381bef7defaf
      https://github.com/llvm/llvm-project/commit/279c7a2f17937836ed13e359c3fb381bef7defaf
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M clang/lib/Serialization/ASTWriterDecl.cpp
    R clang/test/Modules/no-eager-load.cppm

  Log Message:
  -----------
  Revert "[C++20] [Modules] Don't load declaration eagerly for named modules"

This reverts commit af86957cbbffd3dfff3c6750ebddf118aebd0069.

Close https://github.com/llvm/llvm-project/issues/61733.

Previously I banned the eagerly loading for declarations from named
modules to speedup the process of reading modules. But I didn't think
about special decls like PragmaCommentDecl and PragmaDetectMismatchDecl.
So here is the issue https://github.com/llvm/llvm-project/issues/61733.

Note that the current behavior is still incorrect. Given:

```
// mod.cppm
module;

export module mod;
```

and

```
// user.cpp
import mod;
```

Now the IR of `user.cpp` will contain the metadata '!0 =
!{!"msvcprt.lib"}' incorrectly. The root cause of the problem is that
`EagerlyDeserializedDecls` is designed for headers and it didn't take
care for named modules. We need to redesign a new mechanism for named
modules.




More information about the All-commits mailing list