Added -Xdisable-fake-override-validator

(cherry picked from commit d921dc1f946114fcf4a4fbdb0bf3593c0b97b9a7)
This commit is contained in:
Alexander Gorshenev
2020-06-25 00:15:49 +03:00
committed by Vasily Levchenko
parent 0192182f11
commit 92722a480e
4 changed files with 10 additions and 2 deletions
@@ -249,6 +249,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
parseShortModuleName(arguments, configuration, outputKind)?.let { parseShortModuleName(arguments, configuration, outputKind)?.let {
put(SHORT_MODULE_NAME, it) put(SHORT_MODULE_NAME, it)
} }
put(DISABLE_FAKE_OVERRIDE_VALIDATOR, arguments.disableFakeOverrideValidator)
} }
} }
} }
@@ -145,6 +145,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
) )
var exportedLibraries: Array<String>? = null var exportedLibraries: Array<String>? = null
@Argument(value="-Xdisable-fake-override-validator", description = "Disable IR fake override validator")
var disableFakeOverrideValidator: Boolean = false
@Argument( @Argument(
value = "-Xframework-import-header", value = "-Xframework-import-header",
valueDescription = "<header>", valueDescription = "<header>",
@@ -18,6 +18,8 @@ class KonanConfigKeys {
= CompilerConfigurationKey.create("compatible compiler versions") = CompilerConfigurationKey.create("compatible compiler versions")
val DEBUG: CompilerConfigurationKey<Boolean> val DEBUG: CompilerConfigurationKey<Boolean>
= CompilerConfigurationKey.create("add debug information") = CompilerConfigurationKey.create("add debug information")
val DISABLE_FAKE_OVERRIDE_VALIDATOR: CompilerConfigurationKey<Boolean>
= CompilerConfigurationKey.create("disable fake override validator")
val DISABLED_PHASES: CompilerConfigurationKey<List<String>> val DISABLED_PHASES: CompilerConfigurationKey<List<String>>
= CompilerConfigurationKey.create("disable backend phases") = CompilerConfigurationKey.create("disable backend phases")
val BITCODE_EMBEDDING_MODE: CompilerConfigurationKey<BitcodeEmbedding.Mode> val BITCODE_EMBEDDING_MODE: CompilerConfigurationKey<BitcodeEmbedding.Mode>
@@ -254,8 +254,10 @@ internal val psiToIrPhase = konanUnitPhase(
symbolTable.noUnboundLeft("Unbound symbols left after linker") symbolTable.noUnboundLeft("Unbound symbols left after linker")
module.acceptVoid(ManglerChecker(KonanManglerIr, Ir2DescriptorManglerAdapter(KonanManglerDesc))) module.acceptVoid(ManglerChecker(KonanManglerIr, Ir2DescriptorManglerAdapter(KonanManglerDesc)))
val fakeOverrideChecker = FakeOverrideChecker(KonanManglerIr, KonanManglerDesc) if (!config.configuration.getBoolean(KonanConfigKeys.DISABLE_FAKE_OVERRIDE_VALIDATOR)) {
linker.modules.values.forEach{ fakeOverrideChecker.check(it) } val fakeOverrideChecker = FakeOverrideChecker(KonanManglerIr, KonanManglerDesc)
linker.modules.values.forEach { fakeOverrideChecker.check(it) }
}
irModule = module irModule = module