/// \brief Report a diagnostic.
DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID);
- /// \brief Given the global ID for an identifier, retrieve the
- /// corresponding identifier information.
- ///
- /// \param ID The global ID.
- ///
- /// \param StartOutOfDate If true, don't actually read the identifier
- /// contents (macro definition, etc.). Instead, put the identifier in the
- /// "out-of-date" state to its contents to be loaded later.
- IdentifierInfo *DecodeIdentifierInfo(serialization::IdentifierID ID,
- bool StartOutOfDate = false);
+ IdentifierInfo *DecodeIdentifierInfo(serialization::IdentifierID ID);
IdentifierInfo *GetIdentifierInfo(ModuleFile &M, const RecordData &Record,
- unsigned &Idx,
- bool StartOutOfDate = false) {
- return DecodeIdentifierInfo(getGlobalIdentifierID(M, Record[Idx++]),
- StartOutOfDate);
+ unsigned &Idx) {
+ return DecodeIdentifierInfo(getGlobalIdentifierID(M, Record[Idx++]));
}
virtual IdentifierInfo *GetIdentifier(serialization::IdentifierID ID) {
return DecodeIdentifierInfo(ID);
}
- IdentifierInfo *getLocalIdentifier(ModuleFile &M, unsigned LocalID,
- bool StartOutOfDate = false);
+ IdentifierInfo *getLocalIdentifier(ModuleFile &M, unsigned LocalID);
serialization::IdentifierID getGlobalIdentifierID(ModuleFile &M,
unsigned LocalID);
SelectorTable &SelTable = Reader.getContext().Selectors;
unsigned N = ReadUnalignedLE16(d);
IdentifierInfo *FirstII
- = Reader.getLocalIdentifier(F, ReadUnalignedLE32(d), true);
+ = Reader.getLocalIdentifier(F, ReadUnalignedLE32(d));
if (N == 0)
return SelTable.getNullarySelector(FirstII);
else if (N == 1)
SmallVector<IdentifierInfo *, 16> Args;
Args.push_back(FirstII);
for (unsigned I = 1; I != N; ++I)
- Args.push_back(Reader.getLocalIdentifier(F, ReadUnalignedLE32(d), true));
+ Args.push_back(Reader.getLocalIdentifier(F, ReadUnalignedLE32(d)));
return SelTable.getSelector(N, Args.data());
}
}
}
-IdentifierInfo *ASTReader::DecodeIdentifierInfo(IdentifierID ID,
- bool StartOutOfDate) {
+IdentifierInfo *ASTReader::DecodeIdentifierInfo(IdentifierID ID) {
if (ID == 0)
return 0;
const unsigned char *StrLenPtr = (const unsigned char*) Str - 2;
unsigned StrLen = (((unsigned) StrLenPtr[0])
| (((unsigned) StrLenPtr[1]) << 8)) - 1;
-
- StringRef Name(Str, StrLen);
- if (StartOutOfDate) {
- IdentifiersLoaded[ID] = &PP.getIdentifierTable().getOwn(Name);
- IdentifiersLoaded[ID]->setOutOfDate(true);
- } else {
- IdentifiersLoaded[ID]
- = &PP.getIdentifierTable().get(Name);
- }
+ IdentifiersLoaded[ID]
+ = &PP.getIdentifierTable().get(StringRef(Str, StrLen));
if (DeserializationListener)
DeserializationListener->IdentifierRead(ID + 1, IdentifiersLoaded[ID]);
}
return IdentifiersLoaded[ID];
}
-IdentifierInfo *ASTReader::getLocalIdentifier(ModuleFile &M, unsigned LocalID,
- bool StartOutOfDate) {
- return DecodeIdentifierInfo(getGlobalIdentifierID(M, LocalID),
- StartOutOfDate);
+IdentifierInfo *ASTReader::getLocalIdentifier(ModuleFile &M, unsigned LocalID) {
+ return DecodeIdentifierInfo(getGlobalIdentifierID(M, LocalID));
}
IdentifierID ASTReader::getGlobalIdentifierID(ModuleFile &M, unsigned LocalID) {
DeclarationName::NameKind Kind = (DeclarationName::NameKind)Record[Idx++];
switch (Kind) {
case DeclarationName::Identifier:
- return DeclarationName(GetIdentifierInfo(F, Record, Idx, true));
+ return DeclarationName(GetIdentifierInfo(F, Record, Idx));
case DeclarationName::ObjCZeroArgSelector:
case DeclarationName::ObjCOneArgSelector: