[llvm-branch-commits] [clang] [Serialization] No transitive identifier change (PR #92085)

Chuanqi Xu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 27 00:37:49 PDT 2024


================
@@ -3896,7 +3903,7 @@ void ASTWriter::WriteIdentifierTable(Preprocessor &PP,
 
       // Write out identifiers if either the ID is local or the identifier has
       // changed since it was loaded.
-      if (ID >= FirstIdentID || !Chain || !II->isFromAST() ||
+      if (isLocalIdentifierID(ID) || !Chain || !II->isFromAST() ||
----------------
ChuanqiXu9 wrote:

Maybe it is because the name `FirstIdentID` is confusing. The proper name may be `FirstLocalIdentID`.

Previously, before this patch, `FirstIdentID` will be `Number of identifier ID` + 1. This is the reason why the encoding of Identifier IDs may be affected by imported modules. This is also the major motivation of the patch. 

So all the ID bigger or equal to FirstIdentID must be the ID for local identifiers previously. But it won't be the case we make this patch.

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


More information about the llvm-branch-commits mailing list