Add new ArchSpec methods, IsCompatibleMatch() and IsExactMatch().
authorJason Molenda <jmolenda@apple.com>
Sun, 4 Nov 2012 03:20:05 +0000 (03:20 +0000)
committerJason Molenda <jmolenda@apple.com>
Sun, 4 Nov 2012 03:20:05 +0000 (03:20 +0000)
commitba813dc03c7a4d6ea68f00ef91c31c20e6540534
tree1cb0fb10c2c1cec8015d857c7a8926c0d9b63e25
parent40f87b1d53acff6b2c885062f5b59c327d8295f7
Add new ArchSpec methods, IsCompatibleMatch() and IsExactMatch().
The operator== method is a synonym for IsExactMatch().

The essential difference between these two is that IsCompatibleMatch()
will say that armv7 and armv7s are compatible and return true.
IsExactMatch() will say that armv7 and armv7s are not a match.

An armv7s cpu can run either generic armv7 binaries or armv7s binaries
(the latter being tuned for it).  When we're picking the slice of a
universal Mach-O file to load in an armv7s Target, we need to be able to
first look for an exact cpu subtype match (armv7s == armv7s) and failing
that, looking for a slice with a compatible architecture.

Update ObjectContainerUniversalMachO::GetObjectFile to prefer an exact
match of the cpu type, falling back to a compatible match if necessary.

<rdar://problem/12593515>

llvm-svn: 167365
lldb/include/lldb/Core/ArchSpec.h
lldb/source/Core/ArchSpec.cpp
lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp