[cfe-commits] r50920 - in /cfe/trunk/Driver: RewriteMacros.cpp clang.cpp clang.h

Chris Lattner sabre at nondot.org
Fri May 9 15:43:24 PDT 2008


Author: lattner
Date: Fri May  9 17:43:24 2008
New Revision: 50920

URL: http://llvm.org/viewvc/llvm-project?rev=50920&view=rev
Log:
make #if 0 code compile, even though it still isn't very useful.

Modified:
    cfe/trunk/Driver/RewriteMacros.cpp
    cfe/trunk/Driver/clang.cpp
    cfe/trunk/Driver/clang.h

Modified: cfe/trunk/Driver/RewriteMacros.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteMacros.cpp?rev=50920&r1=50919&r2=50920&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteMacros.cpp (original)
+++ cfe/trunk/Driver/RewriteMacros.cpp Fri May  9 17:43:24 2008
@@ -23,20 +23,18 @@
 using namespace clang;
 
 /// RewriteMacrosInInput - Implement -rewrite-macros mode.
-void clang::RewriteMacrosInInput(Preprocessor &PP,
+void clang::RewriteMacrosInInput(Preprocessor &PP,const std::string &InFileName,
                                  const std::string &OutFileName) {
   SourceManager &SM = PP.getSourceManager();
   
   Rewriter Rewrite;
   Rewrite.setSourceMgr(SM);
 
-#if 0
-  
   // Get the ID and start/end of the main file.
   unsigned MainFileID = SM.getMainFileID();
-  const llvm::MemoryBuffer *MainBuf = SM.getBuffer(MainFileID);
-  const char *MainFileStart = MainBuf->getBufferStart();
-  const char *MainFileEnd = MainBuf->getBufferEnd();
+  //const llvm::MemoryBuffer *MainBuf = SM.getBuffer(MainFileID);
+  //const char *MainFileStart = MainBuf->getBufferStart();
+  //const char *MainFileEnd = MainBuf->getBufferEnd();
  
   
   // Create the output file.
@@ -66,11 +64,4 @@
   } else {
     fprintf(stderr, "No changes\n");
   }
-  // Emit metadata.
-  *OutFile << ResultStr;
-#endif
-  
 }
-
-
-

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

==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Fri May  9 17:43:24 2008
@@ -1244,7 +1244,7 @@
     break;
       
   case RewriteMacros:
-    RewriteMacrosInInput(PP, OutputFile);
+    RewriteMacrosInInput(PP, InFile, OutputFile);
     ClearSourceMgr = true;
     break;
   }

Modified: cfe/trunk/Driver/clang.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.h?rev=50920&r1=50919&r2=50920&view=diff

==============================================================================
--- cfe/trunk/Driver/clang.h (original)
+++ cfe/trunk/Driver/clang.h Fri May  9 17:43:24 2008
@@ -30,7 +30,8 @@
 void DoPrintPreprocessedInput(Preprocessor &PP, const std::string& OutFile);
 
 /// RewriteMacrosInInput - Implement -rewrite-macros mode.
-void RewriteMacrosInInput(Preprocessor &PP, const std::string& OutFile);
+void RewriteMacrosInInput(Preprocessor &PP, const std::string &InFileName,
+                          const std::string& OutFile);
   
 /// CreatePrintParserActionsAction - Return the actions implementation that
 /// implements the -parse-print-callbacks option.





More information about the cfe-commits mailing list