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

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


Author: sabre
Date: Wed Jul 11 11:41:13 2007
New Revision: 39208

URL: http://llvm.org/viewvc/llvm-project?rev=39208&view=rev
Log:
simplify the Preprocessor ctor.

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

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

==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:41:13 2007
@@ -839,7 +839,7 @@
   FileManager &FileMgr = HeaderInfo.getFileMgr();
   
   // Set up the preprocessor with these options.
-  Preprocessor PP(Diags, LangInfo, Target, FileMgr, SourceMgr, HeaderInfo);
+  Preprocessor PP(Diags, LangInfo, Target, SourceMgr, HeaderInfo);
   
   // Install things like __POWERPC__, __GNUC__, etc into the macro table.
   std::vector<char> PrologMacros;
@@ -935,8 +935,8 @@
   }
   
   if (Stats) {
-    PP.getIdentifierTable().PrintStats();
     PP.PrintStats();
+    PP.getIdentifierTable().PrintStats();
     std::cerr << "\n";
   }
 }
@@ -995,10 +995,10 @@
     std::cerr << NumDiagnostics << " diagnostics generated.\n";
   
   if (Stats) {
-    // Printed from low-to-high level.
-    FileMgr.PrintStats();
-    SourceMgr.PrintStats();
+    // Printed from high-to-low level.
     HeaderInfo.PrintStats();
+    SourceMgr.PrintStats();
+    FileMgr.PrintStats();
     std::cerr << "\n";
   }
   

Modified: cfe/cfe/trunk/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Preprocessor.cpp?rev=39208&r1=39207&r2=39208&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/Preprocessor.cpp (original)
+++ cfe/cfe/trunk/Lex/Preprocessor.cpp Wed Jul 11 11:41:13 2007
@@ -43,11 +43,10 @@
 //===----------------------------------------------------------------------===//
 
 Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts,
-                           TargetInfo &target,
-                           FileManager &FM, SourceManager &SM, 
+                           TargetInfo &target, SourceManager &SM, 
                            HeaderSearch &Headers) 
-  : Diags(diags), Features(opts), Target(target), FileMgr(FM), SourceMgr(SM),
-    HeaderInfo(Headers), Identifiers(opts),
+  : Diags(diags), Features(opts), Target(target), FileMgr(Headers.getFileMgr()),
+    SourceMgr(SM), HeaderInfo(Headers), Identifiers(opts),
     CurLexer(0), CurDirLookup(0), CurMacroExpander(0), Callbacks(0) {
   ScratchBuf = new ScratchBuffer(SourceMgr);
       

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

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/Preprocessor.h Wed Jul 11 11:41:13 2007
@@ -113,7 +113,7 @@
   unsigned NumSkipped;
 public:
   Preprocessor(Diagnostic &diags, const LangOptions &opts, TargetInfo &target,
-               FileManager &FM, SourceManager &SM, HeaderSearch &Headers);
+               SourceManager &SM, HeaderSearch &Headers);
   ~Preprocessor();
 
   Diagnostic &getDiagnostics() const { return Diags; }





More information about the cfe-commits mailing list