Skip to content

Commit

Permalink
[NFC] [Serialization] Avoid unnecessary check for if Identifier from AST
Browse files Browse the repository at this point in the history
Inspired by the review process in
#92085.

The check `ID >= FirstIdentID` can cover the following check
`!II->isFromAST()`.
  • Loading branch information
ChuanqiXu9 committed Jun 4, 2024
1 parent a35ac42 commit 799ae77
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions clang/lib/Serialization/ASTWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3895,8 +3895,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() ||
II->hasChangedSinceDeserialization() ||
if (ID >= FirstIdentID || II->hasChangedSinceDeserialization() ||
(Trait.needDecls() &&
II->hasFETokenInfoChangedSinceDeserialization()))
Generator.insert(II, ID, Trait);
Expand Down

0 comments on commit 799ae77

Please sign in to comment.