diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-04-24 17:56:46 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-04-24 17:56:46 +0000 |
commit | f643b9b338b797a824447207d7eab5f1187f4f34 (patch) | |
tree | 1be4189ed6fe8d8d659a4601f14f67937b4e11f2 /lib/Driver/Tools.cpp | |
parent | 40788d909ad52fc732fe0769d0ef22e5edad5e47 (diff) |
NeXT: Clean up dispatch method policy selection.
- Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}.
- Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp.
- No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 2e8db0062d..8ad04aa508 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1230,13 +1230,17 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fobjc_nonfragile_abi) || getToolChain().IsObjCNonFragileABIDefault()) { CmdArgs.push_back("-fobjc-nonfragile-abi"); - - // -fobjc-legacy-dispatch is only relevant with the nonfragile-abi, and - // defaults to off. - if (Args.hasFlag(options::OPT_fobjc_legacy_dispatch, - options::OPT_fno_objc_legacy_dispatch, - getToolChain().IsObjCLegacyDispatchDefault())) - CmdArgs.push_back("-fobjc-legacy-dispatch"); + + // -fobjc-dispatch-method is only relevant with the nonfragile-abi, and + // legacy is the default. + if (!Args.hasFlag(options::OPT_fobjc_legacy_dispatch, + options::OPT_fno_objc_legacy_dispatch, + getToolChain().IsObjCLegacyDispatchDefault())) { + if (getToolChain().UseObjCMixedDispatch()) + CmdArgs.push_back("-fobjc-dispatch-method=mixed"); + else + CmdArgs.push_back("-fobjc-dispatch-method=non-legacy"); + } } } |