summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-05-09 22:43:24 +0000
committerChris Lattner <sabre@nondot.org>2008-05-09 22:43:24 +0000
commit664ef65981badd2f657715f9650e76a682162e5c (patch)
treec3d2b068d8043893390c0744123be7062ecd2907
parentb84407d6ec8a9596a51fae6076f6d6bac66ae057 (diff)
downloadllvm-664ef65981badd2f657715f9650e76a682162e5c.tar.gz
make #if 0 code compile, even though it still isn't very useful.
llvm-svn: 50920
-rw-r--r--clang/Driver/RewriteMacros.cpp17
-rw-r--r--clang/Driver/clang.cpp2
-rw-r--r--clang/Driver/clang.h3
3 files changed, 7 insertions, 15 deletions
diff --git a/clang/Driver/RewriteMacros.cpp b/clang/Driver/RewriteMacros.cpp
index 4f75e8b267ed..8252df65713d 100644
--- a/clang/Driver/RewriteMacros.cpp
+++ b/clang/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/clang/Driver/clang.cpp b/clang/Driver/clang.cpp
index c6ace84ea19b..1071659016bd 100644
--- a/clang/Driver/clang.cpp
+++ b/clang/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/clang/Driver/clang.h b/clang/Driver/clang.h
index 00f80d362fc7..69434b705350 100644
--- a/clang/Driver/clang.h
+++ b/clang/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.