diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-08 23:37:19 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-08 23:37:19 +0000 |
commit | d7502d0a662b5c299125aba04245aefce67cbc22 (patch) | |
tree | 4e3cd07b8e07e53eb7ed534d31a0f926b2899b7d /lib/Driver/Driver.cpp | |
parent | fe8aa47fb6bd4e1feb59d7615fb5948293cde91f (diff) |
Rename HostInfo::getToolChain to HostInfo::CreateToolChain, and don't recreate
the default tool chain when binding the default architecture.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index c817cde4e9..f58c8829eb 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -207,7 +207,7 @@ Compilation *Driver::BuildCompilation(int argc, const char **argv) { Host = GetHostInfo(HostTriple); // The compilation takes ownership of Args. - Compilation *C = new Compilation(*this, *Host->getToolChain(*Args), Args); + Compilation *C = new Compilation(*this, *Host->CreateToolChain(*Args), Args); // FIXME: This behavior shouldn't be here. if (CCCPrintOptions) { @@ -1017,19 +1017,14 @@ void Driver::BuildJobsForAction(Compilation &C, } if (const BindArchAction *BAA = dyn_cast<BindArchAction>(A)) { - const char *ArchName = BAA->getArchName(); + const ToolChain *TC = &C.getDefaultToolChain(); + std::string Arch; - if (!ArchName) { - Arch = C.getDefaultToolChain().getArchName(); - ArchName = Arch.c_str(); - } - BuildJobsForAction(C, - *BAA->begin(), - Host->getToolChain(C.getArgs(), ArchName), - CanAcceptPipe, - AtTopLevel, - LinkingOutput, - Result); + if (BAA->getArchName()) + TC = Host->CreateToolChain(C.getArgs(), BAA->getArchName()); + + BuildJobsForAction(C, *BAA->begin(), TC, CanAcceptPipe, AtTopLevel, + LinkingOutput, Result); return; } |