diff options
author | Justin Lebar <jlebar@google.com> | 2016-01-16 03:30:08 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-01-16 03:30:08 +0000 |
commit | 55c83325ae0f75d789812e5ec54588af14c3b74d (patch) | |
tree | 44a881142d452c5648787ab72768f3b3837fe3e0 /clang/lib/Driver/Driver.cpp | |
parent | a851d7e9ad32947df1b777b6b3b6715bf88251ef (diff) | |
download | bcm5719-llvm-55c83325ae0f75d789812e5ec54588af14c3b74d.tar.gz bcm5719-llvm-55c83325ae0f75d789812e5ec54588af14c3b74d.zip |
Respect bound archs, even when they don't alter the toolchain.
Summary:
It's possible to BindArch without changing the toolchain at all. For
example, armv7 and armv7s have exactly the same toolchain triple.
Therefore the code in the Driver that checks that we're not creating a
job for the same Action twice needs to consider (Action, Toolchain,
BoundArch) tuples.
Reviewers: tra
Subscribers: aemerson, echristo, beanz, cfe-commits
Differential Revision: http://reviews.llvm.org/D16250
llvm-svn: 257983
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 0cdfb4fe105..5c01ef0bba7 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1803,8 +1803,15 @@ InputInfo Driver::BuildJobsForAction( bool AtTopLevel, bool MultipleArchs, const char *LinkingOutput, std::map<std::pair<const Action *, std::string>, InputInfo> &CachedResults) const { - std::pair<const Action *, std::string> ActionTC = { - A, TC->getTriple().normalize()}; + // The bound arch is not necessarily represented in the toolchain's triple -- + // for example, armv7 and armv7s both map to the same triple -- so we need + // both in our map. + std::string TriplePlusArch = TC->getTriple().normalize(); + if (BoundArch) { + TriplePlusArch += "-"; + TriplePlusArch += BoundArch; + } + std::pair<const Action *, std::string> ActionTC = {A, TriplePlusArch}; auto CachedResult = CachedResults.find(ActionTC); if (CachedResult != CachedResults.end()) { return CachedResult->second; |