Author: compnerd Date: Sat Sep 19 13:19:44 2015 New Revision: 248094 URL: http://llvm.org/viewvc/llvm-project?rev=248094&view=rev Log: Driver: tweak ARM target feature calculation
Rather than using re-calculating the effective triple, thread the already calculated value down into AddARMTargetArgs. This avoids both recreating the triple, as well as re-parsing the triple as it was already done in the previous frame. Modified: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/lib/Driver/Tools.h Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=248094&r1=248093&r2=248094&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Sat Sep 19 13:19:44 2015 @@ -851,15 +851,9 @@ static void getARMTargetFeatures(const D Features.push_back("+no-movt"); } -void Clang::AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs, - bool KernelOrKext) const { - const Driver &D = getToolChain().getDriver(); - // Get the effective triple, which takes into account the deployment target. - std::string TripleStr = getToolChain().ComputeEffectiveClangTriple(Args); - llvm::Triple Triple(TripleStr); - +void Clang::AddARMTargetArgs(const llvm::Triple &Triple, const ArgList &Args, + ArgStringList &CmdArgs, bool KernelOrKext) const { // Select the ABI to use. - // // FIXME: Support -meabi. // FIXME: Parts of this are duplicated in the backend, unify this somehow. const char *ABIName = nullptr; @@ -898,7 +892,8 @@ void Clang::AddARMTargetArgs(const ArgLi CmdArgs.push_back(ABIName); // Determine floating point ABI from the options & target defaults. - arm::FloatABI ABI = arm::getARMFloatABI(D, Args, Triple); + arm::FloatABI ABI = + arm::getARMFloatABI(getToolChain().getDriver(), Args, Triple); if (ABI == arm::FloatABI::Soft) { // Floating point operations and argument passing are soft. // FIXME: This changes CPP defines, we need -target-soft-float. @@ -3676,7 +3671,8 @@ void Clang::ConstructJob(Compilation &C, case llvm::Triple::armeb: case llvm::Triple::thumb: case llvm::Triple::thumbeb: - AddARMTargetArgs(Args, CmdArgs, KernelOrKext); + // Use the effective triple, which takes into account the deployment target. + AddARMTargetArgs(Triple, Args, CmdArgs, KernelOrKext); break; case llvm::Triple::aarch64: Modified: cfe/trunk/lib/Driver/Tools.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=248094&r1=248093&r2=248094&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.h (original) +++ cfe/trunk/lib/Driver/Tools.h Sat Sep 19 13:19:44 2015 @@ -59,7 +59,8 @@ private: void AddAArch64TargetArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const; - void AddARMTargetArgs(const llvm::opt::ArgList &Args, + void AddARMTargetArgs(const llvm::Triple &Triple, + const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, bool KernelOrKext) const; void AddARM64TargetArgs(const llvm::opt::ArgList &Args, _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits