summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-07-18 19:56:38 +0000
committerVedant Kumar <vsk@apple.com>2016-07-18 19:56:38 +0000
commitbf51e703cfaf006f3f162d837435de4815e9007e (patch)
tree7a91e21395551a31c536117b0b5ce989d0437722 /clang/lib/Driver/Driver.cpp
parentf2030b931caca4c89e680f125a0d8aa2e6593551 (diff)
downloadbcm5719-llvm-bf51e703cfaf006f3f162d837435de4815e9007e.tar.gz
bcm5719-llvm-bf51e703cfaf006f3f162d837435de4815e9007e.zip
[Driver] Compute effective target triples once per job (NFCI)
Compute an effective target triple exactly once in ConstructJob(), and then simply pass around references to it. This eliminates wasteful re-computation of effective triples (e.g in getARMFloatABI()). Differential Revision: https://reviews.llvm.org/D22290 llvm-svn: 275895
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 61e8fbb2c81..8034e472ce5 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -2256,7 +2256,21 @@ InputInfo Driver::BuildJobsForActionNoCache(
TC->getTriple().normalize()),
BaseInput);
+ llvm::Triple EffectiveTriple;
+ const ArgList &Args = C.getArgsForToolChain(TC, BoundArch);
+ if (InputInfos.size() != 1) {
+ EffectiveTriple = llvm::Triple(
+ T->getToolChain().ComputeEffectiveClangTriple(Args));
+ } else {
+ // Pass along the input type if it can be unambiguously determined.
+ EffectiveTriple =
+ llvm::Triple(T->getToolChain().ComputeEffectiveClangTriple(
+ Args, InputInfos[0].getType()));
+ }
+
if (CCCPrintBindings && !CCGenDiagnostics) {
+ // FIXME: We should be able to use the effective triple here, but doing so
+ // breaks some multi-arch tests.
llvm::errs() << "# \"" << T->getToolChain().getTripleString() << '"'
<< " - \"" << T->getName() << "\", inputs: [";
for (unsigned i = 0, e = InputInfos.size(); i != e; ++i) {
@@ -2266,7 +2280,7 @@ InputInfo Driver::BuildJobsForActionNoCache(
}
llvm::errs() << "], output: " << Result.getAsString() << "\n";
} else {
- T->ConstructJob(C, *JA, Result, InputInfos,
+ T->ConstructJob(C, *JA, Result, InputInfos, EffectiveTriple,
C.getArgsForToolChain(TC, BoundArch), LinkingOutput);
}
return Result;
OpenPOWER on IntegriCloud