diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-02-11 03:16:21 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-02-11 03:16:21 +0000 |
commit | aeea8ac3d82b3ca068a9021e231a86bb74f5e531 (patch) | |
tree | a776e83a40ffd9ac8a2b0f97f631f4a04e2a0961 /clang/lib/Driver/Driver.cpp | |
parent | 84f22f9da17bef2900dda9848718f6ccae4fdc64 (diff) | |
download | bcm5719-llvm-aeea8ac3d82b3ca068a9021e231a86bb74f5e531.tar.gz bcm5719-llvm-aeea8ac3d82b3ca068a9021e231a86bb74f5e531.zip |
Driver: Add -rewrite-objc, which is an interface to clang -cc1 -rewrite-objc.
llvm-svn: 95849
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 53eafd78a64..15df767d970 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -622,6 +622,7 @@ void Driver::BuildActions(const ArgList &Args, ActionList &Actions) const { // -{fsyntax-only,-analyze,emit-ast,S} only run up to the compiler. } else if ((FinalPhaseArg = Args.getLastArg(options::OPT_fsyntax_only)) || + (FinalPhaseArg = Args.getLastArg(options::OPT_rewrite_objc)) || (FinalPhaseArg = Args.getLastArg(options::OPT__analyze, options::OPT__analyze_auto)) || (FinalPhaseArg = Args.getLastArg(options::OPT_emit_ast)) || @@ -742,6 +743,8 @@ Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase, if (Args.hasArg(options::OPT_fsyntax_only)) { return new CompileJobAction(Input, types::TY_Nothing); + } else if (Args.hasArg(options::OPT_rewrite_objc)) { + return new CompileJobAction(Input, types::TY_RewrittenObjC); } else if (Args.hasArg(options::OPT__analyze, options::OPT__analyze_auto)) { return new AnalyzeJobAction(Input, types::TY_Plist); } else if (Args.hasArg(options::OPT_emit_ast)) { @@ -1171,8 +1174,10 @@ bool Driver::ShouldUseClangCompiler(const Compilation &C, const JobAction &JA, return false; } - // Always use clang for precompiling and AST generation, regardless of archs. - if (isa<PrecompileJobAction>(JA) || JA.getType() == types::TY_AST) + // Always use clang for precompiling, AST generation, and rewriting, + // regardless of archs. + if (isa<PrecompileJobAction>(JA) || JA.getType() == types::TY_AST || + JA.getType() == types::TY_RewrittenObjC) return true; // Finally, don't use clang if this isn't one of the user specified archs to |