]> granicus.if.org Git - clang/commitdiff
[PCH] We don't need to instantiate HeaderFileInfoTrait in ASTReader more than once.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 6 Mar 2013 18:12:44 +0000 (18:12 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 6 Mar 2013 18:12:44 +0000 (18:12 +0000)
We can just re-use the one from HeaderFileInfoLookupTable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176565 91177308-0d34-0410-b5e6-96231b3b80d8

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

index abf45995f24813eec2927b9ded11eb41920d91cc..89c604f393ed9b58c060ca20ce1105ee0f6aab59 100644 (file)
@@ -289,10 +289,6 @@ public:
   /// the header files.
   void *HeaderFileInfoTable;
 
-  /// \brief Actual data for the list of framework names used in the header
-  /// search information.
-  const char *HeaderFileFrameworkStrings;
-
   // === Submodule information ===  
   /// \brief The number of submodules in this module.
   unsigned LocalNumSubmodules;
index c8c1cd9cad79e1cf82806f5f7d4a507b29db1fd4..53474f5b0b5c1c65648c488ba729a2e135ae4816 100644 (file)
@@ -2476,7 +2476,6 @@ bool ASTReader::ReadASTBlock(ModuleFile &F) {
     case HEADER_SEARCH_TABLE: {
       F.HeaderFileInfoTableData = Blob.data();
       F.LocalNumHeaderFileInfos = Record[1];
-      F.HeaderFileFrameworkStrings = Blob.data() + Record[2];
       if (Record[0]) {
         F.HeaderFileInfoTable
           = HeaderFileInfoLookupTable::Create(
@@ -4092,31 +4091,25 @@ Optional<bool> ASTReader::isPreprocessedEntityInFileID(unsigned Index,
 namespace {
   /// \brief Visitor used to search for information about a header file.
   class HeaderFileInfoVisitor {
-    ASTReader &Reader;
     const FileEntry *FE;
     
     Optional<HeaderFileInfo> HFI;
     
   public:
-    HeaderFileInfoVisitor(ASTReader &Reader, const FileEntry *FE)
-      : Reader(Reader), FE(FE) { }
+    explicit HeaderFileInfoVisitor(const FileEntry *FE)
+      : FE(FE) { }
     
     static bool visit(ModuleFile &M, void *UserData) {
       HeaderFileInfoVisitor *This
         = static_cast<HeaderFileInfoVisitor *>(UserData);
       
-      HeaderFileInfoTrait Trait(This->Reader, M, 
-                                &This->Reader.getPreprocessor().getHeaderSearchInfo(),
-                                M.HeaderFileFrameworkStrings);
-      
       HeaderFileInfoLookupTable *Table
         = static_cast<HeaderFileInfoLookupTable *>(M.HeaderFileInfoTable);
       if (!Table)
         return false;
 
       // Look in the on-disk hash table for an entry for this file name.
-      HeaderFileInfoLookupTable::iterator Pos = Table->find(This->FE->getName(),
-                                                            &Trait);
+      HeaderFileInfoLookupTable::iterator Pos = Table->find(This->FE->getName());
       if (Pos == Table->end())
         return false;
 
@@ -4129,7 +4122,7 @@ namespace {
 }
 
 HeaderFileInfo ASTReader::GetHeaderFileInfo(const FileEntry *FE) {
-  HeaderFileInfoVisitor Visitor(*this, FE);
+  HeaderFileInfoVisitor Visitor(FE);
   ModuleMgr.visit(&HeaderFileInfoVisitor::visit, &Visitor);
   if (Optional<HeaderFileInfo> HFI = Visitor.getHeaderFileInfo()) {
     if (Listener)
index 27242d54da9d77bfd92e1feb5470b552d4d834b8..2eb397176a1293cdd0976a9bd2beebf6c8b9d251 100644 (file)
@@ -33,7 +33,7 @@ ModuleFile::ModuleFile(ModuleKind Kind, unsigned Generation)
     PreprocessedEntityOffsets(0), NumPreprocessedEntities(0),
     LocalNumHeaderFileInfos(0), 
     HeaderFileInfoTableData(0), HeaderFileInfoTable(0),
-    HeaderFileFrameworkStrings(0), LocalNumSubmodules(0), BaseSubmoduleID(0),
+    LocalNumSubmodules(0), BaseSubmoduleID(0),
     LocalNumSelectors(0), SelectorOffsets(0), BaseSelectorID(0),
     SelectorLookupTableData(0), SelectorLookupTable(0), LocalNumDecls(0),
     DeclOffsets(0), BaseDeclID(0),