aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Driver/RewriteMacros.cpp17
-rw-r--r--Driver/clang.cpp2
-rw-r--r--Driver/clang.h3
3 files changed, 7 insertions, 15 deletions
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.