]> granicus.if.org Git - clang/commitdiff
make #if 0 code compile, even though it still isn't very useful.
authorChris Lattner <sabre@nondot.org>
Fri, 9 May 2008 22:43:24 +0000 (22:43 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 9 May 2008 22:43:24 +0000 (22:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50920 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteMacros.cpp
Driver/clang.cpp
Driver/clang.h

index 4f75e8b267ed7345f0569da515f1a7c78802f5b7..8252df65713dd3d6544ade7ed6b4201590082f76 100644 (file)
 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 @@ void clang::RewriteMacrosInInput(Preprocessor &PP,
   } else {
     fprintf(stderr, "No changes\n");
   }
-  // Emit metadata.
-  *OutFile << ResultStr;
-#endif
-  
 }
-
-
-
index c6ace84ea19be347c5a6de4c738e73d7660a80b9..1071659016bd734e48015f5b869f33eadd3040eb 100644 (file)
@@ -1244,7 +1244,7 @@ static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF,
     break;
       
   case RewriteMacros:
-    RewriteMacrosInInput(PP, OutputFile);
+    RewriteMacrosInInput(PP, InFile, OutputFile);
     ClearSourceMgr = true;
     break;
   }
index 00f80d362fc79f290e5f1e425ede7f0138b3085b..69434b7053505763dd92f075b592845f18209b04 100644 (file)
@@ -30,7 +30,8 @@ class SourceManager;
 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.