From: Chris Lattner Date: Fri, 9 May 2008 22:43:24 +0000 (+0000) Subject: make #if 0 code compile, even though it still isn't very useful. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0951052064e1c29c6ac9b873764fa6bfc2685817;p=clang make #if 0 code compile, even though it still isn't very useful. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50920 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Driver/RewriteMacros.cpp b/Driver/RewriteMacros.cpp index 4f75e8b267..8252df6571 100644 --- a/Driver/RewriteMacros.cpp +++ b/Driver/RewriteMacros.cpp @@ -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 @@ void clang::RewriteMacrosInInput(Preprocessor &PP, } else { fprintf(stderr, "No changes\n"); } - // Emit metadata. - *OutFile << ResultStr; -#endif - } - - - diff --git a/Driver/clang.cpp b/Driver/clang.cpp index c6ace84ea1..1071659016 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -1244,7 +1244,7 @@ static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF, break; case RewriteMacros: - RewriteMacrosInInput(PP, OutputFile); + RewriteMacrosInInput(PP, InFile, OutputFile); ClearSourceMgr = true; break; } diff --git a/Driver/clang.h b/Driver/clang.h index 00f80d362f..69434b7053 100644 --- a/Driver/clang.h +++ b/Driver/clang.h @@ -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.