]> granicus.if.org Git - clang/commitdiff
Revert r173056; it breaks one of the CodeGen-with-PCH tests.
authorDouglas Gregor <dgregor@apple.com>
Mon, 21 Jan 2013 16:52:34 +0000 (16:52 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 21 Jan 2013 16:52:34 +0000 (16:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173058 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Serialization/ASTReader.h
lib/Serialization/ASTReader.cpp

index d6d6148ffdbfdc5560da50721162f8d78767d7af..994008de44bd822f068e6f32edb6b654f6e5ea99 100644 (file)
@@ -1515,22 +1515,11 @@ public:
   /// \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) {
@@ -1540,8 +1529,7 @@ public:
     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);
index e360d8dde2eb7fd28bf3c7436be9c03293387f36..db850f3f83fe75eba6c6378457af2801c47291ef 100644 (file)
@@ -398,7 +398,7 @@ ASTSelectorLookupTrait::ReadKey(const unsigned char* d, unsigned) {
   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)
@@ -407,7 +407,7 @@ ASTSelectorLookupTrait::ReadKey(const unsigned char* d, unsigned) {
   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());
 }
@@ -6038,8 +6038,7 @@ ASTReader::SetGloballyVisibleDecls(IdentifierInfo *II,
   }
 }
 
-IdentifierInfo *ASTReader::DecodeIdentifierInfo(IdentifierID ID,
-                                                bool StartOutOfDate) {
+IdentifierInfo *ASTReader::DecodeIdentifierInfo(IdentifierID ID) {
   if (ID == 0)
     return 0;
 
@@ -6064,15 +6063,8 @@ IdentifierInfo *ASTReader::DecodeIdentifierInfo(IdentifierID ID,
     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]);
   }
@@ -6080,10 +6072,8 @@ IdentifierInfo *ASTReader::DecodeIdentifierInfo(IdentifierID 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) {
@@ -6219,7 +6209,7 @@ ASTReader::ReadDeclarationName(ModuleFile &F,
   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: