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.
rdar://problem/45041492
Could we avoid C-style casts, and in this case use static_cast although in this case it is obvious, using explicit casts avoids bugs in the long-term due to changes in type and cv-qualifiers etc... and makes your intent clear.
I personally would advocate for -Wold-style-cast being a hard error in C++ code.