Skip to content

Commit 799ae77

Browse files
committed
[NFC] [Serialization] Avoid unnecessary check for if Identifier from AST
Inspired by the review process in #92085. The check `ID >= FirstIdentID` can cover the following check `!II->isFromAST()`.
1 parent a35ac42 commit 799ae77

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3895,8 +3895,7 @@ void ASTWriter::WriteIdentifierTable(Preprocessor &PP,
38953895

38963896
// Write out identifiers if either the ID is local or the identifier has
38973897
// changed since it was loaded.
3898-
if (ID >= FirstIdentID || !Chain || !II->isFromAST() ||
3899-
II->hasChangedSinceDeserialization() ||
3898+
if (ID >= FirstIdentID || II->hasChangedSinceDeserialization() ||
39003899
(Trait.needDecls() &&
39013900
II->hasFETokenInfoChangedSinceDeserialization()))
39023901
Generator.insert(II, ID, Trait);

0 commit comments

Comments
 (0)