diff options
author | Eric Christopher <echristo@gmail.com> | 2013-02-18 01:16:37 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-02-18 01:16:37 +0000 |
commit | 6c7db8967c383d859eab6d541db816adbeb837a9 (patch) | |
tree | dbbfde699fc607cf4dd1e97c7f056748a5e9a9f2 /lib/Driver/Tools.cpp | |
parent | 3fcdea71152ed2e3efedbf8e3b3c1309dae67ab6 (diff) |
Unify some "kernel or kext" conditionals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index f827122106..f5ea38bec4 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1914,8 +1914,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Note that these flags are trump-cards. Regardless of the order w.r.t. the // PIC or PIE options above, if these show up, PIC is disabled. llvm::Triple Triple(TripleStr); - if ((Args.hasArg(options::OPT_mkernel) || - Args.hasArg(options::OPT_fapple_kext)) && + if (KernelOrKext && (Triple.getOS() != llvm::Triple::IOS || Triple.isOSVersionLT(6))) PIC = PIE = false; @@ -2975,8 +2974,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-fpack-struct=1"); } - if (Args.hasArg(options::OPT_mkernel) || - Args.hasArg(options::OPT_fapple_kext)) { + if (KernelOrKext) { if (!Args.hasArg(options::OPT_fcommon)) CmdArgs.push_back("-fno-common"); Args.ClaimAllArgs(options::OPT_fno_common); @@ -3982,7 +3980,7 @@ void darwin::Assemble::ConstructJob(Compilation &C, const JobAction &JA, if (getToolChain().getTriple().getArch() != llvm::Triple::x86_64 && (((Args.hasArg(options::OPT_mkernel) || - Args.hasArg(options::OPT_fapple_kext)) && + Args.hasArg(options::OPT_fapple_kext)) && (!getDarwinToolChain().isTargetIPhoneOS() || getDarwinToolChain().isIPhoneOSVersionLT(6, 0))) || Args.hasArg(options::OPT_static))) |