[all-commits] [llvm/llvm-project] d4d95e: [Serialization] Register identifiers in ahead and ...
Chuanqi Xu via All-commits
all-commits at lists.llvm.org
Fri Jun 21 02:51:14 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d4d95ee65159db1ea1a8c4159cfdaf8b81097897
https://github.com/llvm/llvm-project/commit/d4d95ee65159db1ea1a8c4159cfdaf8b81097897
Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
Date: 2024-06-21 (Fri, 21 Jun 2024)
Changed paths:
M clang/include/clang/Serialization/ASTWriter.h
M clang/lib/Serialization/ASTWriter.cpp
M clang/test/Modules/decl-params-determinisim.m
A clang/test/Modules/no-transitive-identifier-change-2.cppm
Log Message:
-----------
[Serialization] Register identifiers in ahead and don't emit predefined decls
See the added test for the motivation example. In that example, we add a
new function declaration in `a.cppm` and this is not used in the reduced
BMI of `b.cppm`. We expect that the change won't affect the BMI of
`b.cppm`. But it is the not the case.
There are 2 reason for unexpected result:
1. We would register the interesting identifiers in a pretty late phase.
This may cause some some predefined identifier ID change due to we
insert other identifiers during emitting decls and types.
2. In `GenerateNameLookup`, we would generate information for predefined
decls. This may not be intended. Since every predefined decl doesn't
belong to any module.
And this patch solves the first issue by registering the identifiers in
the very early posititon to make sure the ID won't get affected by the
process to emit decls and types. And we solve the second question by
filtering predefined decls simply.
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