Added "optimize" flag to settings everywhere

This commit is contained in:
Denis Zharkov
2014-07-11 12:39:14 +04:00
committed by Alexander Udalov
parent 433c9cd4a5
commit 0e683b0b99
28 changed files with 301 additions and 25 deletions
@@ -39,6 +39,9 @@ public class JVMConfigurationKeys {
public static final CompilerConfigurationKey<Boolean> ENABLE_INLINE =
CompilerConfigurationKey.create("enable inline");
public static final CompilerConfigurationKey<Boolean> ENABLE_OPTIMIZATION =
CompilerConfigurationKey.create("enable optimization");
public static final CompilerConfigurationKey<File> INCREMENTAL_CACHE_BASE_DIR =
CompilerConfigurationKey.create("incremental cache base dir");
@@ -35,6 +35,7 @@ import org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler;
import org.jetbrains.jet.cli.jvm.repl.ReplFromTerminal;
import org.jetbrains.jet.codegen.CompilationException;
import org.jetbrains.jet.codegen.inline.InlineCodegenUtil;
import org.jetbrains.jet.codegen.optimization.OptimizationUtils;
import org.jetbrains.jet.config.CommonConfigurationKeys;
import org.jetbrains.jet.config.CompilerConfiguration;
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
@@ -116,6 +117,8 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments> {
configuration.put(JVMConfigurationKeys.GENERATE_NOT_NULL_PARAMETER_ASSERTIONS, arguments.notNullParamAssertions);
configuration.put(JVMConfigurationKeys.ENABLE_INLINE,
CompilerArgumentsUtil.optionToBooleanFlag(arguments.inline, InlineCodegenUtil.DEFAULT_INLINE_FLAG));
configuration.put(JVMConfigurationKeys.ENABLE_OPTIMIZATION,
CompilerArgumentsUtil.optionToBooleanFlag(arguments.optimize, OptimizationUtils.DEFAULT_OPTIMIZATION_FLAG));
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector);
@@ -209,7 +212,11 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments> {
super.checkArguments(argument);
if (!CompilerArgumentsUtil.checkOption(argument.inline)) {
throw new IllegalArgumentException(CompilerArgumentsUtil.getWrongInlineOptionErrorMessage(argument.inline));
throw new IllegalArgumentException(CompilerArgumentsUtil.getWrongCheckOptionErrorMessage("inline", argument.inline));
}
if (!CompilerArgumentsUtil.checkOption(argument.optimize)) {
throw new IllegalArgumentException(CompilerArgumentsUtil.getWrongCheckOptionErrorMessage("optimize", argument.optimize));
}
}
@@ -40,6 +40,7 @@ import org.jetbrains.jet.cli.common.messages.MessageCollector;
import org.jetbrains.jet.cli.jvm.JVMConfigurationKeys;
import org.jetbrains.jet.codegen.*;
import org.jetbrains.jet.codegen.inline.InlineCodegenUtil;
import org.jetbrains.jet.codegen.optimization.OptimizationUtils;
import org.jetbrains.jet.codegen.state.GenerationState;
import org.jetbrains.jet.codegen.state.Progress;
import org.jetbrains.jet.config.CommonConfigurationKeys;
@@ -344,6 +345,7 @@ public class KotlinToJVMBytecodeCompiler {
configuration.get(JVMConfigurationKeys.GENERATE_NOT_NULL_PARAMETER_ASSERTIONS, false),
GenerationState.GenerateClassFilter.GENERATE_ALL,
configuration.get(JVMConfigurationKeys.ENABLE_INLINE, InlineCodegenUtil.DEFAULT_INLINE_FLAG),
configuration.get(JVMConfigurationKeys.ENABLE_OPTIMIZATION, OptimizationUtils.DEFAULT_OPTIMIZATION_FLAG),
packagesWithRemovedFiles,
moduleId,
diagnosticHolder,