[cfe-commits] r39211 - in /cfe/cfe/trunk: Driver/clang.cpp include/clang/Lex/HeaderSearch.h

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:41:16 PDT 2007


Author: sabre
Date: Wed Jul 11 11:41:16 2007
New Revision: 39211

URL: http://llvm.org/viewvc/llvm-project?rev=39211&view=rev
Log:
clear file info after processing one file, it shouldn't carry over to the
next.

Modified:
    cfe/cfe/trunk/Driver/clang.cpp
    cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h

Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=39211&r1=39210&r2=39211&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:41:16 2007
@@ -939,8 +939,11 @@
   if (Stats) {
     PP.PrintStats();
     PP.getIdentifierTable().PrintStats();
+    HeaderInfo.PrintStats();
     std::cerr << "\n";
   }
+  
+  HeaderInfo.ClearFileInfo();
 }
 
 static cl::list<std::string>
@@ -988,7 +991,6 @@
   HeaderSearch HeaderInfo(FileMgr);
   InitializeIncludePaths(HeaderInfo, FileMgr, Diags, LangInfo);
   
-  
   for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i)
     ProcessInputFile(InputFilenames[i], SourceMgr, Diags,
                      HeaderInfo, *Target, LangInfo);
@@ -998,7 +1000,6 @@
   
   if (Stats) {
     // Printed from high-to-low level.
-    HeaderInfo.PrintStats();
     SourceMgr.PrintStats();
     FileMgr.PrintStats();
     std::cerr << "\n";

Modified: cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h?rev=39211&r1=39210&r2=39211&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h Wed Jul 11 11:41:16 2007
@@ -91,6 +91,11 @@
     NoCurDirSearch = noCurDirSearch;
   }
   
+  /// ClearFileInfo - Forget everything we know about headers so far.
+  void ClearFileInfo() {
+    FileInfo.clear();
+  }
+  
   /// LookupFile - Given a "foo" or <foo> reference, look up the indicated file,
   /// return null on failure.  isAngled indicates whether the file reference is
   /// a <> reference.  If successful, this returns 'UsedDir', the





More information about the cfe-commits mailing list