diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Driver/Compilation.cpp | 10 | ||||
-rw-r--r-- | lib/Driver/Driver.cpp | 14 |
2 files changed, 13 insertions, 11 deletions
diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp index ad3cb8dbe1..f6e1885643 100644 --- a/lib/Driver/Compilation.cpp +++ b/lib/Driver/Compilation.cpp @@ -31,8 +31,9 @@ Compilation::~Compilation() { delete Args; // Free any derived arg lists. - for (llvm::DenseMap<const ToolChain*, DerivedArgList*>::iterator - it = TCArgs.begin(), ie = TCArgs.end(); it != ie; ++it) + for (llvm::DenseMap<std::pair<const ToolChain*, const char*>, + DerivedArgList*>::iterator it = TCArgs.begin(), + ie = TCArgs.end(); it != ie; ++it) delete it->second; // Free the actions, if built. @@ -41,11 +42,12 @@ Compilation::~Compilation() { delete *it; } -const DerivedArgList &Compilation::getArgsForToolChain(const ToolChain *TC) { +const DerivedArgList &Compilation::getArgsForToolChain(const ToolChain *TC, + const char *BoundArch) { if (!TC) TC = &DefaultToolChain; - DerivedArgList *&Entry = TCArgs[TC]; + DerivedArgList *&Entry = TCArgs[std::make_pair(TC, BoundArch)]; if (!Entry) Entry = TC->TranslateArgs(*Args); diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 24f462f18f..7a0527d2f1 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -948,6 +948,7 @@ void Driver::BuildJobs(Compilation &C) const { InputInfo II; BuildJobsForAction(C, A, &C.getDefaultToolChain(), + /*BoundArch*/0, /*CanAcceptPipe*/ true, /*AtTopLevel*/ true, /*LinkingOutput*/ LinkingOutput, @@ -1001,6 +1002,7 @@ void Driver::BuildJobs(Compilation &C) const { void Driver::BuildJobsForAction(Compilation &C, const Action *A, const ToolChain *TC, + const char *BoundArch, bool CanAcceptPipe, bool AtTopLevel, const char *LinkingOutput, @@ -1032,8 +1034,8 @@ void Driver::BuildJobsForAction(Compilation &C, if (BAA->getArchName()) TC = Host->CreateToolChain(C.getArgs(), BAA->getArchName()); - BuildJobsForAction(C, *BAA->begin(), TC, CanAcceptPipe, AtTopLevel, - LinkingOutput, Result); + BuildJobsForAction(C, *BAA->begin(), TC, BAA->getArchName(), + CanAcceptPipe, AtTopLevel, LinkingOutput, Result); return; } @@ -1061,10 +1063,8 @@ void Driver::BuildJobsForAction(Compilation &C, for (ActionList::const_iterator it = Inputs->begin(), ie = Inputs->end(); it != ie; ++it) { InputInfo II; - BuildJobsForAction(C, *it, TC, TryToUsePipeInput, - /*AtTopLevel*/false, - LinkingOutput, - II); + BuildJobsForAction(C, *it, TC, BoundArch, TryToUsePipeInput, + /*AtTopLevel*/false, LinkingOutput, II); InputInfos.push_back(II); } @@ -1125,7 +1125,7 @@ void Driver::BuildJobsForAction(Compilation &C, llvm::errs() << "], output: " << Result.getAsString() << "\n"; } else { T.ConstructJob(C, *JA, *Dest, Result, InputInfos, - C.getArgsForToolChain(TC), LinkingOutput); + C.getArgsForToolChain(TC, BoundArch), LinkingOutput); } } |