[cfe-commits] r69827 - in /cfe/trunk: include/clang/Frontend/PCHReader.h lib/Frontend/PCHReader.cpp

Douglas Gregor dgregor at apple.com
Wed Apr 22 14:15:06 PDT 2009


Author: dgregor
Date: Wed Apr 22 16:15:06 2009
New Revision: 69827

URL: http://llvm.org/viewvc/llvm-project?rev=69827&view=rev
Log:
Eliminate some FIXMEs in the PCH reader that were either already fixed or aren't actually things to fix

Modified:
    cfe/trunk/include/clang/Frontend/PCHReader.h
    cfe/trunk/lib/Frontend/PCHReader.cpp

Modified: cfe/trunk/include/clang/Frontend/PCHReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/PCHReader.h?rev=69827&r1=69826&r2=69827&view=diff

==============================================================================
--- cfe/trunk/include/clang/Frontend/PCHReader.h (original)
+++ cfe/trunk/include/clang/Frontend/PCHReader.h Wed Apr 22 16:15:06 2009
@@ -327,9 +327,9 @@
   /// supplements.
   ASTContext &getContext() { return Context; }
 
-  // FIXME: temporary hack to store declarations that we deserialized
-  // before we had access to the Sema object.
-  llvm::SmallVector<NamedDecl *, 16> TUDecls;
+  // \brief Contains declarations that were loaded before we have
+  // access to a Sema object.
+  llvm::SmallVector<NamedDecl *, 16> PreloadedDecls;
 
   /// \brief Retrieve the semantic analysis object used to analyze the
   /// translation unit in which the precompiled header is being

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=69827&r1=69826&r2=69827&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Wed Apr 22 16:15:06 2009
@@ -1107,7 +1107,7 @@
                            const unsigned char* d,
                            unsigned DataLen) {
     using namespace clang::io;
-    uint32_t Bits = ReadUnalignedLE32(d); // FIXME: use these?
+    uint32_t Bits = ReadUnalignedLE32(d);
     bool CPlusPlusOperatorKeyword = Bits & 0x01;
     Bits >>= 1;
     bool Poisoned = Bits & 0x01;
@@ -1160,7 +1160,6 @@
     Sema *SemaObj = Reader.getSema();
     while (DataLen > 0) {
       NamedDecl *D = cast<NamedDecl>(Reader.GetDecl(ReadUnalignedLE32(d)));
-
       if (SemaObj) {
         // Introduce this declaration into the translation-unit scope
         // and add it to the declaration chain for this identifier, so
@@ -1171,9 +1170,7 @@
         // Queue this declaration so that it will be added to the
         // translation unit scope and identifier's declaration chain
         // once a Sema object is known.
-        // FIXME: This is a temporary hack. It will go away once we have
-        // lazy deserialization of macros.
-        Reader.TUDecls.push_back(D);
+        Reader.PreloadedDecls.push_back(D);
       }
 
       DataLen -= 4;
@@ -1680,8 +1677,6 @@
                         (const unsigned char *)IdentifierTableData + Record[0],
                         (const unsigned char *)IdentifierTableData, 
                         PCHIdentifierLookupTrait(*this));
-      // FIXME: What about any identifiers already placed into the
-      // identifier table? Should we load decls with those names now?
       PP.getIdentifierTable().setExternalIdentifierLookup(this);
       break;
 
@@ -2521,14 +2516,13 @@
 void PCHReader::InitializeSema(Sema &S) {
   SemaObj = &S;
  
-  // FIXME: this makes sure any declarations that were deserialized
-  // "too early" still get added to the identifier's declaration
-  // chains.
-  for (unsigned I = 0, N = TUDecls.size(); I != N; ++I) {
-    SemaObj->TUScope->AddDecl(Action::DeclPtrTy::make(TUDecls[I]));
-    SemaObj->IdResolver.AddDecl(TUDecls[I]);
+  // Makes sure any declarations that were deserialized "too early"
+  // still get added to the identifier's declaration chains.
+  for (unsigned I = 0, N = PreloadedDecls.size(); I != N; ++I) {
+    SemaObj->TUScope->AddDecl(Action::DeclPtrTy::make(PreloadedDecls[I]));
+    SemaObj->IdResolver.AddDecl(PreloadedDecls[I]);
   }
-  TUDecls.clear();
+  PreloadedDecls.clear();
 }
 
 IdentifierInfo* PCHReader::get(const char *NameStart, const char *NameEnd) {





More information about the cfe-commits mailing list