Move default inline flag to JVM back-end

- other back-ends are likely to have its own value of this flag
- get rid of DEFAULT_INLINE_FLAG_FOR_TEST
- the main goal was to simplify the default GenerationState constructor, which
  now always uses default inline flag value
This commit is contained in:
Alexander Udalov
2014-05-05 23:09:09 +04:00
parent 9679e3ce4a
commit d42598a935
13 changed files with 46 additions and 59 deletions
@@ -117,8 +117,8 @@ public open class KotlinCompile(): AbstractCompile() {
args.noJdkAnnotations = true
args.inline = kotlinOptions.inline
if (!CompilerArgumentsUtil.checkInlineOption(args.inline)) {
throw GradleException(CompilerArgumentsUtil.getWrongOptionErrorMessage(args.inline))
if (!CompilerArgumentsUtil.checkOption(args.inline)) {
throw GradleException(CompilerArgumentsUtil.getWrongInlineOptionErrorMessage(args.inline))
}
val messageCollector = GradleMessageCollector(logger)
@@ -34,6 +34,7 @@ import org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity;
import org.jetbrains.jet.cli.common.messages.MessageCollector;
import org.jetbrains.jet.cli.jvm.K2JVMCompiler;
import org.jetbrains.jet.cli.common.arguments.CompilerArgumentsUtil;
import org.jetbrains.jet.codegen.inline.InlineCodegenUtil;
import java.io.File;
import java.io.IOException;
@@ -313,10 +314,10 @@ public abstract class KotlinCompileMojoBase extends AbstractMojo {
arguments.annotations = getFullAnnotationsPath(log, annotationPaths);
log.info("Using kotlin annotations from " + arguments.annotations);
arguments.inline = inline;
if (!CompilerArgumentsUtil.checkInlineOption(arguments.inline)) {
throw new MojoExecutionException(CompilerArgumentsUtil.getWrongOptionErrorMessage(arguments.inline));
if (!CompilerArgumentsUtil.checkOption(arguments.inline)) {
throw new MojoExecutionException(CompilerArgumentsUtil.getWrongInlineOptionErrorMessage(arguments.inline));
}
log.info("Method inlining is " + CompilerArgumentsUtil.optionToInlineFlag(arguments.inline));
log.info("Method inlining is " + CompilerArgumentsUtil.optionToBooleanFlag(arguments.inline, InlineCodegenUtil.DEFAULT_INLINE_FLAG));
}
protected String getFullAnnotationsPath(Log log, List<String> annotations) {