[all-commits] [llvm/llvm-project] 5a41fc: [clang][modules] Name the module map files on PCM ...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Fri Apr 11 08:20:33 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5a41fc28f3b3f32a70fd5d81c2e33d10b3225806
      https://github.com/llvm/llvm-project/commit/5a41fc28f3b3f32a70fd5d81c2e33d10b3225806
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2025-04-11 (Fri, 11 Apr 2025)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSerializationKinds.td
    M clang/lib/Serialization/ASTReader.cpp
    M clang/test/ClangScanDeps/modules-relocated-mm-macro.c

  Log Message:
  -----------
  [clang][modules] Name the module map files on PCM file conflict (#134475)

With implicitly-built modules, seeing something like:
```
fatal error: module 'X' is defined in both '<cache>/HASH1/X-HASH2.pcm' and '<cache>/HASH1/X-HASH3.pcm'
```
is super confusing and not actionable, because the module cache tends to
be hidden from the developer.

This PR adds a note to that diagnostic that names the module map files
the PCM files were compiled from, hopefully giving a good enough hint
for further investigation:
```
note: compiled from '<build>/X.framework/Modules/module.modulemap' and '<SDK>/X.framework/Modules/module.modulemap'
```

(I had to replace the mechanism used to convert `DiagnosticError` into
something `DiagnosticsEngine` can understand, because it seemingly did
not support notes.)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list