diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-09-19 18:19:44 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-09-19 18:19:44 +0000 |
| commit | ce63ce947e2f0356f86a274ff4a53aab7c0034a1 (patch) | |
| tree | e36fe3cddf7e5e7c6b1f22ef5fb5188196ecfdf1 /clang | |
| parent | 27f81776ad9ff370b3adfff36919c6aa1fcfdacf (diff) | |
| download | bcm5719-llvm-ce63ce947e2f0356f86a274ff4a53aab7c0034a1.tar.gz bcm5719-llvm-ce63ce947e2f0356f86a274ff4a53aab7c0034a1.zip | |
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.
llvm-svn: 248094
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 16 | ||||
| -rw-r--r-- | clang/lib/Driver/Tools.h | 3 |
2 files changed, 8 insertions, 11 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index b466a5bc069..ce98a6fca8f 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -851,15 +851,9 @@ static void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple, 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 ArgList &Args, ArgStringList &CmdArgs, 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, const JobAction &JA, 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: diff --git a/clang/lib/Driver/Tools.h b/clang/lib/Driver/Tools.h index b1d5d69eb16..2efcba7217a 100644 --- a/clang/lib/Driver/Tools.h +++ b/clang/lib/Driver/Tools.h @@ -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, |

