[lldb] Fill Watch/AppleTV simulator gaps in PlatformDarwin

When running the test suite against the Watch/AppleTV simulator we currently hitting
the unimplemented parts of PlatformDarwin for the respective simulator platforms.

This just adds the respective switch cases.

This whole code path depends on having a valid Target, so can't just unittest this code
without refactoring it. So instead this is tested by just running the testsuite against
the respective simulators (which is how I found this).

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D89106
This commit is contained in:
Raphael Isemann 2020-10-13 14:35:55 +02:00
parent 937d782e38
commit f4f4d54ae0
1 changed files with 14 additions and 0 deletions

View File

@ -1325,6 +1325,12 @@ FileSpec PlatformDarwin::GetSDKDirectoryForModules(XcodeSDK::Type sdk_type) {
case XcodeSDK::Type::iPhoneOS:
sdks_spec.AppendPathComponent("iPhoneOS.platform");
break;
case XcodeSDK::Type::WatchSimulator:
sdks_spec.AppendPathComponent("WatchSimulator.platform");
break;
case XcodeSDK::Type::AppleTVSimulator:
sdks_spec.AppendPathComponent("AppleTVSimulator.platform");
break;
default:
llvm_unreachable("unsupported sdk");
}
@ -1567,6 +1573,14 @@ void PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
minimum_version_option.PutCString("-mmacosx-version-min=");
minimum_version_option.PutCString(version.getAsString());
break;
case XcodeSDK::Type::WatchSimulator:
minimum_version_option.PutCString("-mwatchos-simulator-version-min=");
minimum_version_option.PutCString(version.getAsString());
break;
case XcodeSDK::Type::AppleTVSimulator:
minimum_version_option.PutCString("-mtvos-version-min=");
minimum_version_option.PutCString(version.getAsString());
break;
default:
llvm_unreachable("unsupported sdk");
}