6 Commits

Author SHA1 Message Date
Krzysztof Parzyszek
e44c28f07e
[clang] Replace "can't" and "can not" in diagnostics with "cannot" (#116623)
See
https://discourse.llvm.org/t/cant-cannot-can-not-in-diagnostic-messages/83171
2024-11-18 15:28:17 -06:00
Chuanqi Xu
cc4ec6daf0 [C++20] [Modules] Diagnose redeclarations from different modules
[basic.link]/p10:

> If two declarations of an entity are attached to different modules,
> the program is ill-formed

But we only implemented the check for ODR. In this patch, we tried to
diagnose the redeclarations from different modules.
2024-06-24 19:03:31 +08:00
Chuanqi Xu
a0b6747804 [C++20] [Modules] Don't perform ODR checks in GMF
Close https://github.com/llvm/llvm-project/issues/79240.

See the linked issue for details. Given the frequency of issue reporting
about false positive ODR checks (I received private issue reports too),
I'd like to backport this to 18.x too.
2024-01-29 11:44:59 +08:00
Chuanqi Xu
5bbadec2d1 Recommit [C++20] [Modules] Don't load declaration eagerly for named modules
Close https://github.com/llvm/llvm-project/issues/61064.

The root cause of the issue is that we will deserilize some declarations
eagerly when reading the BMI. However, many declarations in the BMI are
not necessary for the importer. So it wastes a lot of time.

The new commit handles the MSVC's extension #pragma comment and #pragma
detect_mismatch to follow MSVC's behavior. See pr61783 for details.
2023-04-06 11:01:58 +08:00
Chuanqi Xu
279c7a2f17 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.
2023-03-29 11:15:38 +08:00
Chuanqi Xu
af86957cbb [C++20] [Modules] Don't load declaration eagerly for named modules
Close https://github.com/llvm/llvm-project/issues/61064.

The root cause of the issue is that we will deserilize some declarations
eagerly when reading the BMI. However, many declarations in the BMI are
not necessary for the importer. So it wastes a lot of time.
2023-03-10 14:57:21 +08:00