Allow explicit verification control.
This commit is contained in:
committed by
Nikolay Igotti
parent
56702d5c67
commit
e61a85e811
@@ -160,16 +160,14 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
|||||||
|
|
||||||
put(PURGE_USER_LIBS, arguments.purgeUserLibs)
|
put(PURGE_USER_LIBS, arguments.purgeUserLibs)
|
||||||
|
|
||||||
put(VERIFY_IR, arguments.verifyIr)
|
if (arguments.verifyCompiler != null)
|
||||||
put(VERIFY_DESCRIPTORS, arguments.verifyDescriptors)
|
put(VERIFY_COMPILER, arguments.verifyCompiler == "true")
|
||||||
put(VERIFY_BITCODE, arguments.verifyBitCode)
|
put(VERIFY_BITCODE, arguments.verifyBitCode)
|
||||||
|
|
||||||
put(ENABLED_PHASES,
|
put(ENABLED_PHASES,
|
||||||
arguments.enablePhases.toNonNullList())
|
arguments.enablePhases.toNonNullList())
|
||||||
put(DISABLED_PHASES,
|
put(DISABLED_PHASES,
|
||||||
arguments.disablePhases.toNonNullList())
|
arguments.disablePhases.toNonNullList())
|
||||||
put(VERBOSE_PHASES,
|
|
||||||
arguments.verbosePhases.toNonNullList())
|
|
||||||
put(LIST_PHASES, arguments.listPhases)
|
put(LIST_PHASES, arguments.listPhases)
|
||||||
|
|
||||||
put(COMPATIBLE_COMPILER_VERSIONS,
|
put(COMPATIBLE_COMPILER_VERSIONS,
|
||||||
|
|||||||
@@ -163,11 +163,8 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
|||||||
@Argument(value = "-Xverify-bitcode", deprecatedName = "--verify_bitcode", description = "Verify llvm bitcode after each method")
|
@Argument(value = "-Xverify-bitcode", deprecatedName = "--verify_bitcode", description = "Verify llvm bitcode after each method")
|
||||||
var verifyBitCode: Boolean = false
|
var verifyBitCode: Boolean = false
|
||||||
|
|
||||||
@Argument(value = "-Xverify-descriptors", deprecatedName = "--verify_descriptors", description = "Verify descriptor tree")
|
@Argument(value = "-Xverify-compiler", description = "Verify compiler")
|
||||||
var verifyDescriptors: Boolean = false
|
var verifyCompiler: String? = null
|
||||||
|
|
||||||
@Argument(value = "-Xverify-ir", deprecatedName = "--verify_ir", description = "Verify IR")
|
|
||||||
var verifyIr: Boolean = false
|
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
value = "-friend-modules",
|
value = "-friend-modules",
|
||||||
|
|||||||
+5
@@ -48,6 +48,11 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
|||||||
|
|
||||||
val memoryModel: MemoryModel get() = configuration.get(KonanConfigKeys.MEMORY_MODEL)!!
|
val memoryModel: MemoryModel get() = configuration.get(KonanConfigKeys.MEMORY_MODEL)!!
|
||||||
|
|
||||||
|
val needCompilerVerification: Boolean
|
||||||
|
get() = configuration.get(KonanConfigKeys.VERIFY_COMPILER) ?:
|
||||||
|
(configuration.getBoolean(KonanConfigKeys.OPTIMIZATION) ||
|
||||||
|
KonanVersion.CURRENT.meta != MetaVersion.RELEASE)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
if (!platformManager.isEnabled(target)) {
|
if (!platformManager.isEnabled(target)) {
|
||||||
error("Target ${target.visibleName} is not available on the ${HostManager.hostName} host")
|
error("Target ${target.visibleName} is not available on the ${HostManager.hostName} host")
|
||||||
|
|||||||
+3
-7
@@ -102,18 +102,14 @@ class KonanConfigKeys {
|
|||||||
= CompilerConfigurationKey.create("directory for temporary files")
|
= CompilerConfigurationKey.create("directory for temporary files")
|
||||||
val VERIFY_BITCODE: CompilerConfigurationKey<Boolean>
|
val VERIFY_BITCODE: CompilerConfigurationKey<Boolean>
|
||||||
= CompilerConfigurationKey.create("verify bitcode")
|
= CompilerConfigurationKey.create("verify bitcode")
|
||||||
val VERIFY_DESCRIPTORS: CompilerConfigurationKey<Boolean>
|
val VERIFY_COMPILER: CompilerConfigurationKey<Boolean>
|
||||||
= CompilerConfigurationKey.create("verify descriptors")
|
= CompilerConfigurationKey.create("verify compiler")
|
||||||
val VERIFY_IR: CompilerConfigurationKey<Boolean>
|
|
||||||
= CompilerConfigurationKey.create("verify ir")
|
|
||||||
val VERBOSE_PHASES: CompilerConfigurationKey<List<String>>
|
|
||||||
= CompilerConfigurationKey.create("verbose backend phases")
|
|
||||||
val DEBUG_INFO_VERSION: CompilerConfigurationKey<Int>
|
val DEBUG_INFO_VERSION: CompilerConfigurationKey<Int>
|
||||||
= CompilerConfigurationKey.create("debug info format version")
|
= CompilerConfigurationKey.create("debug info format version")
|
||||||
val COVERAGE: CompilerConfigurationKey<Boolean>
|
val COVERAGE: CompilerConfigurationKey<Boolean>
|
||||||
= CompilerConfigurationKey.create("emit coverage info for sources")
|
= CompilerConfigurationKey.create("emit coverage info for sources")
|
||||||
val LIBRARIES_TO_COVER: CompilerConfigurationKey<List<String>>
|
val LIBRARIES_TO_COVER: CompilerConfigurationKey<List<String>>
|
||||||
= CompilerConfigurationKey.create<List<String>>("libraries that should be covered")
|
= CompilerConfigurationKey.create("libraries that should be covered")
|
||||||
val PROFRAW_PATH: CompilerConfigurationKey<String?>
|
val PROFRAW_PATH: CompilerConfigurationKey<String?>
|
||||||
= CompilerConfigurationKey.create("path to *.profraw coverage output")
|
= CompilerConfigurationKey.create("path to *.profraw coverage output")
|
||||||
val OBJC_GENERICS: CompilerConfigurationKey<Boolean>
|
val OBJC_GENERICS: CompilerConfigurationKey<Boolean>
|
||||||
|
|||||||
+3
@@ -26,6 +26,8 @@ import org.jetbrains.kotlin.psi2ir.Psi2IrTranslator
|
|||||||
import java.util.Collections.emptySet
|
import java.util.Collections.emptySet
|
||||||
|
|
||||||
internal fun moduleValidationCallback(state: ActionState, module: IrModuleFragment, context: Context) {
|
internal fun moduleValidationCallback(state: ActionState, module: IrModuleFragment, context: Context) {
|
||||||
|
if (!context.config.needCompilerVerification) return
|
||||||
|
|
||||||
val validatorConfig = IrValidatorConfig(
|
val validatorConfig = IrValidatorConfig(
|
||||||
abortOnError = false,
|
abortOnError = false,
|
||||||
ensureAllNodesAreDifferent = true,
|
ensureAllNodesAreDifferent = true,
|
||||||
@@ -371,5 +373,6 @@ internal fun PhaseConfig.konanPhasesConfig(config: KonanConfig) {
|
|||||||
switch(buildDFGPhase, config.configuration.getBoolean(KonanConfigKeys.OPTIMIZATION))
|
switch(buildDFGPhase, config.configuration.getBoolean(KonanConfigKeys.OPTIMIZATION))
|
||||||
switch(devirtualizationPhase, config.configuration.getBoolean(KonanConfigKeys.OPTIMIZATION))
|
switch(devirtualizationPhase, config.configuration.getBoolean(KonanConfigKeys.OPTIMIZATION))
|
||||||
switch(dcePhase, config.configuration.getBoolean(KonanConfigKeys.OPTIMIZATION))
|
switch(dcePhase, config.configuration.getBoolean(KonanConfigKeys.OPTIMIZATION))
|
||||||
|
switch(verifyBitcodePhase, config.needCompilerVerification || config.configuration.getBoolean(KonanConfigKeys.VERIFY_BITCODE))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user