Fix a bug PlatformDarwin::SDKSupportsModule.
authorAdrian Prantl <aprantl@apple.com>
Thu, 25 Oct 2018 15:30:43 +0000 (15:30 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 25 Oct 2018 15:30:43 +0000 (15:30 +0000)
commit10deee997df8ba9aeb4f479ecc2f794fa5e41371
tree1772cafccc81855ffa727bc8b47bb0def8a6a591
parenta8a24aa0420a53583d17023eeec64fcce08d3092
Fix a bug PlatformDarwin::SDKSupportsModule.

This fixes a bug PlatformDarwin::SDKSupportsModule introduced by
https://reviews.llvm.org/D47889.  VersionTuple::tryParse() can deal
with an optional third (micro) component, but the parse will fail when
there are extra characters after the version number (e.g.: trying to
parse the substring "12.0.sdk" out of "iPhoneSimulator12.0.sdk" fails
after that patch).  Fixed here by stripping the ".sdk" suffix first.

(Part of) rdar://problem/45041492

Differential Revision https://reviews.llvm.org/D53677

llvm-svn: 345274
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
lldb/source/Utility/ArchSpec.cpp
lldb/unittests/Platform/PlatformDarwinTest.cpp