diff options
author | Vedant Kumar <vsk@apple.com> | 2016-07-27 23:02:20 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-07-27 23:02:20 +0000 |
commit | 18286cfb7445b12c8d0bab4505bd745a9c9cee60 (patch) | |
tree | b1745aad11e8792b05b1da5afcd4ba8f73fb00d6 /clang/lib/Driver/Driver.cpp | |
parent | 5fb00e4bd7c8f767a18377c91c99dacc2f74089f (diff) | |
download | bcm5719-llvm-18286cfb7445b12c8d0bab4505bd745a9c9cee60.tar.gz bcm5719-llvm-18286cfb7445b12c8d0bab4505bd745a9c9cee60.zip |
Retry: [Driver] Compute effective target triples once per job (NFCI)
Compute an effective triple once per job. Cache the triple in the
prevailing ToolChain for the duration of the job.
Clients which need effective triples now look them up in the ToolChain.
This eliminates wasteful re-computation of effective triples (e.g in
getARMFloatABI()).
While we're at it, delete MachO::ComputeEffectiveClangTriple. It was a
no-op override.
Differential Revision: https://reviews.llvm.org/D22596
llvm-svn: 276937
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 5af480ff537..43ec2164a48 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2247,6 +2247,19 @@ InputInfo Driver::BuildJobsForActionNoCache( InputInfos.append(OffloadDependencesInputInfo.begin(), OffloadDependencesInputInfo.end()); + // Set the effective triple of the toolchain for the duration of this job. + llvm::Triple EffectiveTriple; + const ToolChain &ToolTC = T->getToolChain(); + const ArgList &Args = C.getArgsForToolChain(TC, BoundArch); + if (InputInfos.size() != 1) { + EffectiveTriple = llvm::Triple(ToolTC.ComputeEffectiveClangTriple(Args)); + } else { + // Pass along the input type if it can be unambiguously determined. + EffectiveTriple = llvm::Triple( + ToolTC.ComputeEffectiveClangTriple(Args, InputInfos[0].getType())); + } + RegisterEffectiveTriple TripleRAII(ToolTC, EffectiveTriple); + // Determine the place to write output to, if any. InputInfo Result; if (JA->getType() == types::TY_Nothing) |