summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ArchSpec.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-07-29 18:04:57 +0000
committerGreg Clayton <gclayton@apple.com>2014-07-29 18:04:57 +0000
commita3a6c12c0315d03fd8139606793b0d22ef2a57f6 (patch)
tree65ba10f4ff154661c8c05ddef9dc538bd10366b3 /lldb/source/Core/ArchSpec.cpp
parent86fdba2f3fc36535b2d4fa2dfb56d31d980a00f5 (diff)
downloadbcm5719-llvm-a3a6c12c0315d03fd8139606793b0d22ef2a57f6.tar.gz
bcm5719-llvm-a3a6c12c0315d03fd8139606793b0d22ef2a57f6.zip
When constructing an ArchSpec from a MachO cpu type and subtype, don't set the OS for x86_64 and x86 in case the binary ends up being for macosx or ios.
<rdar://problem/17819272> llvm-svn: 214188
Diffstat (limited to 'lldb/source/Core/ArchSpec.cpp')
-rw-r--r--lldb/source/Core/ArchSpec.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp
index faedcb691d7..c4bca8b8b9a 100644
--- a/lldb/source/Core/ArchSpec.cpp
+++ b/lldb/source/Core/ArchSpec.cpp
@@ -752,6 +752,15 @@ ArchSpec::SetArchitecture (ArchitectureType arch_type, uint32_t cpu, uint32_t su
case llvm::Triple::x86:
case llvm::Triple::x86_64:
+ // Don't set the OS for x86_64 or for x86 as we want to leave it as an "unspecified unknown"
+ // which means if we ask for the OS from the llvm::Triple we get back llvm::Triple::UnknownOS, but
+ // if we ask for the string value for the OS it will come back empty (unspecified).
+ // We do this because we now have iOS and MacOSX as the OS values for x86 and x86_64 for
+ // normal desktop and simulator binaries. And if we compare a "x86_64-apple-ios" to a "x86_64-apple-"
+ // triple, it will say it is compatible (because the OS is unspecified in the second one and will match
+ // anything in the first
+ break;
+
default:
m_triple.setOS (llvm::Triple::MacOSX);
break;
OpenPOWER on IntegriCloud