start implementation of a macro rewriter, this is currently just stubbed out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50845 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 96f6dde..e3362ec 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -63,6 +63,7 @@
enum ProgActions {
RewriteObjC, // ObjC->C Rewriter.
+ RewriteMacros, // Expand macros but not #includes.
HTMLTest, // HTML displayer testing stuff.
EmitLLVM, // Emit a .ll file.
EmitBC, // Emit a .bc file.
@@ -136,7 +137,9 @@
clEnumValN(SerializeAST, "serialize",
"Build ASTs and emit .ast file"),
clEnumValN(RewriteObjC, "rewrite-objc",
- "Playground for the code rewriter"),
+ "Rewrite ObjC into C (code rewriter example)"),
+ clEnumValN(RewriteMacros, "rewrite-macros",
+ "Expand macros without full preprocessing"),
clEnumValEnd));
@@ -1218,7 +1221,7 @@
DoPrintPreprocessedInput(PP, OutputFile);
ClearSourceMgr = true;
break;
-
+
case ParseNoop: // -parse-noop
ParseFile(PP, new MinimalAction(PP.getIdentifierTable()));
ClearSourceMgr = true;
@@ -1232,6 +1235,11 @@
case ParseSyntaxOnly: // -fsyntax-only
Consumer = new ASTConsumer();
break;
+
+ case RewriteMacros:
+ RewriteMacrosInInput(PP, OutputFile);
+ ClearSourceMgr = true;
+ break;
}
if (Consumer) {