File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1736,7 +1736,7 @@ DeclBaseName ModuleFile::getDeclBaseName(IdentifierID IID) {
1736
1736
1737
1737
size_t rawID = IID - NUM_SPECIAL_IDS;
1738
1738
assert (rawID < Identifiers.size () && " invalid identifier ID" );
1739
- auto identRecord = Identifiers[rawID];
1739
+ auto & identRecord = Identifiers[rawID];
1740
1740
1741
1741
if (identRecord.Offset == 0 )
1742
1742
return identRecord.Ident ;
@@ -1748,7 +1748,11 @@ DeclBaseName ModuleFile::getDeclBaseName(IdentifierID IID) {
1748
1748
assert (terminatorOffset != StringRef::npos &&
1749
1749
" unterminated identifier string data" );
1750
1750
1751
- return getContext ().getIdentifier (rawStrPtr.slice (0 , terminatorOffset));
1751
+ // Cache the resulting identifier.
1752
+ identRecord.Ident =
1753
+ getContext ().getIdentifier (rawStrPtr.slice (0 , terminatorOffset));
1754
+ identRecord.Offset = 0 ;
1755
+ return identRecord.Ident ;
1752
1756
}
1753
1757
1754
1758
Identifier ModuleFile::getIdentifier (IdentifierID IID) {
You can’t perform that action at this time.
0 commit comments