From 9779e92fa4e659381b86f75726da0848fcc66bd3 Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Thu, 18 Sep 2008 14:10:13 +0000 Subject: Add driver support for invoking block rewriter. Also tweaked the create function to take an explicit output file. llvm-svn: 56305 --- clang/Driver/clang.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/Driver/clang.cpp') diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp index 0efe56a3507..ff98bff9dc8 100644 --- a/clang/Driver/clang.cpp +++ b/clang/Driver/clang.cpp @@ -61,6 +61,7 @@ Stats("print-stats", enum ProgActions { RewriteObjC, // ObjC->C Rewriter. + RewriteBlocks, // ObjC->C Rewriter for Blocks. RewriteMacros, // Expand macros but not #includes. HTMLTest, // HTML displayer testing stuff. EmitLLVM, // Emit a .ll file. @@ -116,6 +117,8 @@ ProgAction(llvm::cl::desc("Choose output type:"), llvm::cl::ZeroOrMore, "Rewrite ObjC into C (code rewriter example)"), clEnumValN(RewriteMacros, "rewrite-macros", "Expand macros without full preprocessing"), + clEnumValN(RewriteBlocks, "rewrite-blocks", + "Rewrite Blocks to C"), clEnumValEnd)); @@ -989,6 +992,9 @@ static ASTConsumer* CreateASTConsumer(const std::string& InFile, case RewriteObjC: return CreateCodeRewriterTest(InFile, OutputFile, Diag, LangOpts); + + case RewriteBlocks: + return CreateBlockRewriter(InFile, OutputFile, Diag, LangOpts); case RunAnalysis: assert (!AnalysisList.empty()); -- cgit v1.2.3