diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-09 18:36:01 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-09 18:36:01 +0000 |
commit | 4954018954bbc97363eef02d0c83bea19ce9b329 (patch) | |
tree | 13dce0e9c1e1d4d0cf59426a4608f7234897527c /lib/Driver | |
parent | 1eb4433ac451dc16f4133a88af2d002ac26c58ef (diff) |
Push bound architecture name into Compilation::getArgsForToolChain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver')
-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); } } |