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(VERIFY_IR, arguments.verifyIr)
|
||||
put(VERIFY_DESCRIPTORS, arguments.verifyDescriptors)
|
||||
if (arguments.verifyCompiler != null)
|
||||
put(VERIFY_COMPILER, arguments.verifyCompiler == "true")
|
||||
put(VERIFY_BITCODE, arguments.verifyBitCode)
|
||||
|
||||
put(ENABLED_PHASES,
|
||||
arguments.enablePhases.toNonNullList())
|
||||
put(DISABLED_PHASES,
|
||||
arguments.disablePhases.toNonNullList())
|
||||
put(VERBOSE_PHASES,
|
||||
arguments.verbosePhases.toNonNullList())
|
||||
put(LIST_PHASES, arguments.listPhases)
|
||||
|
||||
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")
|
||||
var verifyBitCode: Boolean = false
|
||||
|
||||
@Argument(value = "-Xverify-descriptors", deprecatedName = "--verify_descriptors", description = "Verify descriptor tree")
|
||||
var verifyDescriptors: Boolean = false
|
||||
|
||||
@Argument(value = "-Xverify-ir", deprecatedName = "--verify_ir", description = "Verify IR")
|
||||
var verifyIr: Boolean = false
|
||||
@Argument(value = "-Xverify-compiler", description = "Verify compiler")
|
||||
var verifyCompiler: String? = null
|
||||
|
||||
@Argument(
|
||||
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 needCompilerVerification: Boolean
|
||||
get() = configuration.get(KonanConfigKeys.VERIFY_COMPILER) ?:
|
||||
(configuration.getBoolean(KonanConfigKeys.OPTIMIZATION) ||
|
||||
KonanVersion.CURRENT.meta != MetaVersion.RELEASE)
|
||||
|
||||
init {
|
||||
if (!platformManager.isEnabled(target)) {
|
||||
error("Target ${target.visibleName} is not available on the ${HostManager.hostName} host")
|
||||
|
||||
+5
-9
@@ -46,7 +46,7 @@ class KonanConfigKeys {
|
||||
= CompilerConfigurationKey.create("library version")
|
||||
val LINKER_ARGS: CompilerConfigurationKey<List<String>>
|
||||
= CompilerConfigurationKey.create("additional linker arguments")
|
||||
val LIST_PHASES: CompilerConfigurationKey<Boolean>
|
||||
val LIST_PHASES: CompilerConfigurationKey<Boolean>
|
||||
= CompilerConfigurationKey.create("list backend phases")
|
||||
val LIST_TARGETS: CompilerConfigurationKey<Boolean>
|
||||
= CompilerConfigurationKey.create("list available targets")
|
||||
@@ -100,20 +100,16 @@ class KonanConfigKeys {
|
||||
= CompilerConfigurationKey.create("target we compile for")
|
||||
val TEMPORARY_FILES_DIR: CompilerConfigurationKey<String?>
|
||||
= CompilerConfigurationKey.create("directory for temporary files")
|
||||
val VERIFY_BITCODE: CompilerConfigurationKey<Boolean>
|
||||
val VERIFY_BITCODE: CompilerConfigurationKey<Boolean>
|
||||
= CompilerConfigurationKey.create("verify bitcode")
|
||||
val VERIFY_DESCRIPTORS: CompilerConfigurationKey<Boolean>
|
||||
= CompilerConfigurationKey.create("verify descriptors")
|
||||
val VERIFY_IR: CompilerConfigurationKey<Boolean>
|
||||
= CompilerConfigurationKey.create("verify ir")
|
||||
val VERBOSE_PHASES: CompilerConfigurationKey<List<String>>
|
||||
= CompilerConfigurationKey.create("verbose backend phases")
|
||||
val VERIFY_COMPILER: CompilerConfigurationKey<Boolean>
|
||||
= CompilerConfigurationKey.create("verify compiler")
|
||||
val DEBUG_INFO_VERSION: CompilerConfigurationKey<Int>
|
||||
= CompilerConfigurationKey.create("debug info format version")
|
||||
val COVERAGE: CompilerConfigurationKey<Boolean>
|
||||
= CompilerConfigurationKey.create("emit coverage info for sources")
|
||||
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?>
|
||||
= CompilerConfigurationKey.create("path to *.profraw coverage output")
|
||||
val OBJC_GENERICS: CompilerConfigurationKey<Boolean>
|
||||
|
||||
+3
@@ -26,6 +26,8 @@ import org.jetbrains.kotlin.psi2ir.Psi2IrTranslator
|
||||
import java.util.Collections.emptySet
|
||||
|
||||
internal fun moduleValidationCallback(state: ActionState, module: IrModuleFragment, context: Context) {
|
||||
if (!context.config.needCompilerVerification) return
|
||||
|
||||
val validatorConfig = IrValidatorConfig(
|
||||
abortOnError = false,
|
||||
ensureAllNodesAreDifferent = true,
|
||||
@@ -371,5 +373,6 @@ internal fun PhaseConfig.konanPhasesConfig(config: KonanConfig) {
|
||||
switch(buildDFGPhase, config.configuration.getBoolean(KonanConfigKeys.OPTIMIZATION))
|
||||
switch(devirtualizationPhase, 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