Add a new -rewrite-test option, which is basically a
playground to experiment with some new rewriter approaches. For now
it is probably the most complex version of 'cat' ever invented.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57406 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 91d5212..ae7ec87 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -66,6 +66,7 @@
RewriteObjC, // ObjC->C Rewriter.
RewriteBlocks, // ObjC->C Rewriter for Blocks.
RewriteMacros, // Expand macros but not #includes.
+ RewriteTest, // Rewriter playground
HTMLTest, // HTML displayer testing stuff.
EmitLLVM, // Emit a .ll file.
EmitBC, // Emit a .bc file.
@@ -119,6 +120,8 @@
"Build ASTs then convert to LLVM, emit .bc file"),
clEnumValN(SerializeAST, "serialize",
"Build ASTs and emit .ast file"),
+ clEnumValN(RewriteTest, "rewrite-test",
+ "Rewriter playground"),
clEnumValN(RewriteObjC, "rewrite-objc",
"Rewrite ObjC into C (code rewriter example)"),
clEnumValN(RewriteMacros, "rewrite-macros",
@@ -1173,6 +1176,11 @@
RewriteMacrosInInput(PP, InFile, OutputFile);
ClearSourceMgr = true;
break;
+
+ case RewriteTest:
+ DoRewriteTest(PP, InFile, OutputFile);
+ ClearSourceMgr = true;
+ break;
}
if (Consumer) {