[clang] [clang] Disambiguate GMF internal functions across partitions (PR #219238)

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 2 07:52:53 PDT 2026


cjc0013 wrote:

Agreed. I reworked this so the functions remain distinct entities.

- `ASTContext::isSameEntity` now treats internal-linkage functions owned by different global module fragments as different entities, regardless of whether their bodies are equivalent.
- The ABI mangler remains unchanged. Classic CodeGen uniquifies only colliding backend-local IR names so both declarations and their references survive; the corresponding CIR path has been updated the same way.
- The previous ASTReader ODR-hash logic has been removed.
- The regression now verifies that both equivalent and different bodies compile with `-fskip-odr-check-in-gmf`, emit two helper definitions and two distinct call targets, and, for different bodies, preserve the respective return values.

Validation:

- affected AST, serialization, and classic CodeGen compilation plus clang relink: passed
- focused GMF regression: 1 passed
- adjacent C++20 module tests: 13 passed
- changed-line formatting and `git diff --check`: clean

This checkout is configured without `CLANG_ENABLE_CIR`, so the CIR mirror was not locally compiled. Local build and runtime validation cover the AST and classic CodeGen paths.


https://github.com/llvm/llvm-project/pull/219238


More information about the cfe-commits mailing list