Push bound architecture name into Compilation::getArgsForToolChain.
llvm-svn: 81365
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp
index ad3cb8d..f6e1885 100644
--- a/clang/lib/Driver/Compilation.cpp
+++ b/clang/lib/Driver/Compilation.cpp
@@ -31,8 +31,9 @@
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 @@
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);