Check pre- and postconditions on phases

This commit is contained in:
Georgy Bronnikov
2019-02-15 06:43:46 +03:00
parent 48433110a4
commit da13d3288e
8 changed files with 245 additions and 129 deletions
@@ -238,6 +238,18 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
)
var profilePhases: Boolean by FreezableVar(false)
@Argument(
value = "-Xcheck-conditions",
description = "Check pre- and postconditions on phases"
)
var checkPhaseConditions: Boolean by FreezableVar(false)
@Argument(
value = "-Xcheck-sticky-conditions",
description = "Run sticky condition checks on subsequent phases as well. Implies -Xcheck-conditions"
)
var checkStickyConditions: Boolean by FreezableVar(false)
open fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
return HashMap<AnalysisFlag<*>, Any>().apply {
put(AnalysisFlags.skipMetadataVersionCheck, skipMetadataVersionCheck)
@@ -53,6 +53,8 @@ fun <A : CommonCompilerArguments> CompilerConfiguration.setupCommonArguments(
}
put(CommonConfigurationKeys.PROFILE_PHASES, arguments.profilePhases)
put(CommonConfigurationKeys.CHECK_PHASE_CONDITIONS, arguments.checkPhaseConditions or arguments.checkStickyConditions)
put(CommonConfigurationKeys.CHECK_STICKY_CONDITIONS, arguments.checkStickyConditions)
}
fun <A : CommonCompilerArguments> CompilerConfiguration.setupLanguageVersionSettings(arguments: A) {