Introduce unspecifiedJvmPlatform for clients without jvmTarget

Previously, a lot of clients used JvmPlatform as platform-marker,
without thinking about jvmTarget.

For the sake of migration, this commits introduced so-called
UnspecifiedJvmPlatform, which can be used for a time being, but
generally, all usages should be removed in  future.
This commit is contained in:
Dmitry Savvinov
2019-05-23 18:31:42 +03:00
parent ef39e2a68f
commit 8997fa52df
41 changed files with 57 additions and 57 deletions
@@ -594,7 +594,7 @@ abstract class AbstractDiagnosticsTest : BaseDiagnosticsTest() {
when {
nameSuffix.isEmpty() -> null // TODO(dsavvinov): this leads to 'null'-platform in ModuleDescriptor
nameSuffix == "COMMON" -> CommonPlatforms.defaultCommonPlatform
nameSuffix == "JVM" -> JvmPlatforms.defaultJvmPlatform // TODO(dsavvinov): determine JvmTarget precisely
nameSuffix == "JVM" -> JvmPlatforms.unspecifiedJvmPlatform // TODO(dsavvinov): determine JvmTarget precisely
nameSuffix == "JS" -> JsPlatforms.defaultJsPlatform
nameSuffix == "NATIVE" -> KonanPlatforms.defaultKonanPlatform
else -> throw IllegalStateException("Can't determine platform by name $nameSuffix")
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
class FirTestModuleInfo(
override val name: Name = Name.identifier("TestModule"),
val dependencies: MutableList<ModuleInfo> = mutableListOf(),
override val platform: TargetPlatform = JvmPlatforms.defaultJvmPlatform,
override val platform: TargetPlatform = JvmPlatforms.unspecifiedJvmPlatform,
override val analyzerServices: PlatformDependentAnalyzerServices = JvmPlatformAnalyzerServices
) : ModuleInfo {
override fun dependencies(): List<ModuleInfo> = dependencies
@@ -67,7 +67,7 @@ private class TestModule(val dependsOnBuiltIns: Boolean) : ModuleInfo {
ModuleInfo.DependencyOnBuiltIns.NONE
override val platform: TargetPlatform
get() = JvmPlatforms.defaultJvmPlatform
get() = JvmPlatforms.unspecifiedJvmPlatform
override val analyzerServices: PlatformDependentAnalyzerServices
get() = JvmPlatformAnalyzerServices