kotlin-compiler:1.1-20170417.154352-466

- Fix usage of new Kotlin command line arguments API
(cherry picked from commit fb8534d05d2f69902fd1add631754f7cdfb75c89)
This commit is contained in:
Alexander Udalov
2017-04-14 20:54:48 +03:00
committed by vvlevchenko
parent e60754474a
commit a4eceb3e3a
2 changed files with 28 additions and 40 deletions
@@ -17,99 +17,87 @@
package org.jetbrains.kotlin.cli.bc; package org.jetbrains.kotlin.cli.bc;
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments; import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments;
import org.jetbrains.kotlin.cli.common.arguments.ValueDescription; import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.parser.com.sampullara.cli.Argument;
public class K2NativeCompilerArguments extends CommonCompilerArguments { public class K2NativeCompilerArguments extends CommonCompilerArguments {
@Argument(value = "output", alias = "o", description = "Output file path") @Argument(value = "-output", shortName = "-o", valueDescription = "<path>", description = "Output file path")
@ValueDescription("<path>")
public String outputFile; public String outputFile;
@Argument(value = "runtime", description = "Override standard \'runtime.bc\' location") @Argument(value = "-runtime", valueDescription = "<path>", description = "Override standard 'runtime.bc' location")
@ValueDescription("<path>")
public String runtimeFile; public String runtimeFile;
@Argument(value = "properties", description = "Override standard \'konan.properties\' location") @Argument(value = "-properties", valueDescription = "<path>", description = "Override standard 'konan.properties' location")
@ValueDescription("<path>")
public String propertyFile; public String propertyFile;
@Argument(value = "library", alias = "l", description = "Link with the library") @Argument(value = "-library", shortName = "-l", valueDescription = "<path>", description = "Link with the library")
@ValueDescription("<path>")
public String[] libraries; public String[] libraries;
@Argument(value = "nativelibrary", alias = "nl", description = "Include the native library") @Argument(value = "-nativelibrary", shortName = "-nl", valueDescription = "<path>", description = "Include the native library")
@ValueDescription("<path>")
public String[] nativeLibraries; public String[] nativeLibraries;
@Argument(value = "nolink", description = "Don't link, just produce a bitcode file") @Argument(value = "-nolink", description = "Don't link, just produce a bitcode file")
public boolean nolink; public boolean nolink;
@Argument(value = "nomain", description = "Assume 'main' entry point to be provided by external libraries") @Argument(value = "-nomain", description = "Assume 'main' entry point to be provided by external libraries")
public boolean nomain; public boolean nomain;
@Argument(value = "linkerArgs", description = "Pass arguments to linker", delimiter = " ") @Argument(value = "-linkerArgs", valueDescription = "<arg>", description = "Pass arguments to linker", delimiter = " ")
@ValueDescription("<arg>")
public String[] linkerArguments; public String[] linkerArguments;
@Argument(value = "nostdlib", description = "Don't link with stdlib") @Argument(value = "-nostdlib", description = "Don't link with stdlib")
public boolean nostdlib; public boolean nostdlib;
@Argument(value = "opt", description = "Enable optimizations during compilation") @Argument(value = "-opt", description = "Enable optimizations during compilation")
public boolean optimization; public boolean optimization;
@Argument(value = "target", description = "Set hardware target") @Argument(value = "-target", valueDescription = "<target>", description = "Set hardware target")
@ValueDescription("<target>")
public String target; public String target;
@Argument(value = "enable_assertions", alias = "ea", description = "Enable runtime assertions in generated code") @Argument(value = "-enable_assertions", shortName = "-ea", description = "Enable runtime assertions in generated code")
public boolean enableAssertions; public boolean enableAssertions;
// The rest of the options are only interesting for developers. // The rest of the options are only interesting for developers.
// Make sure to prepend them with double dash. // Make sure to prepend them with double dash.
@Argument(value = "list_targets", description = "List available hardware targets") @Argument(value = "-list_targets", description = "List available hardware targets")
public boolean listTargets; public boolean listTargets;
@Argument(value = "print_ir", prefix = "--", description = "Print IR") @Argument(value = "--print_ir", description = "Print IR")
public boolean printIr; public boolean printIr;
@Argument(value = "print_ir_with_descriptors", prefix = "--", description = "Print IR with descriptors") @Argument(value = "--print_ir_with_descriptors", description = "Print IR with descriptors")
public boolean printIrWithDescriptors; public boolean printIrWithDescriptors;
@Argument(value = "print_descriptors", prefix = "--", description = "Print descriptor tree") @Argument(value = "--print_descriptors", description = "Print descriptor tree")
public boolean printDescriptors; public boolean printDescriptors;
@Argument(value = "print_locations", prefix = "--", description = "Print locations") @Argument(value = "--print_locations", description = "Print locations")
public boolean printLocations; public boolean printLocations;
@Argument(value = "print_bitcode", prefix = "--", description = "Print llvm bitcode") @Argument(value = "--print_bitcode", description = "Print llvm bitcode")
public boolean printBitCode; public boolean printBitCode;
@Argument(value = "verify_ir", prefix = "--", description = "Verify IR") @Argument(value = "--verify_ir", description = "Verify IR")
public boolean verifyIr; public boolean verifyIr;
@Argument(value = "verify_descriptors", prefix = "--", description = "Verify descriptor tree") @Argument(value = "--verify_descriptors", description = "Verify descriptor tree")
public boolean verifyDescriptors; public boolean verifyDescriptors;
@Argument(value = "verify_bitcode", prefix = "--", description = "Verify llvm bitcode after each method") @Argument(value = "--verify_bitcode", description = "Verify llvm bitcode after each method")
public boolean verifyBitCode; public boolean verifyBitCode;
@Argument(value = "enable", prefix = "--", description = "Enable backend phase") @Argument(value = "--enable", valueDescription = "<Phase>", description = "Enable backend phase")
@ValueDescription("<Phase>")
public String[] enablePhases; public String[] enablePhases;
@Argument(value = "disable", prefix = "--", description = "Disable backend phase") @Argument(value = "--disable", valueDescription = "<Phase>", description = "Disable backend phase")
@ValueDescription("<Phase>")
public String[] disablePhases; public String[] disablePhases;
@Argument(value = "verbose", prefix = "--", description = "Trace phase execution") @Argument(value = "--verbose", valueDescription = "<Phase>", description = "Trace phase execution")
@ValueDescription("<Phase>")
public String[] verbosePhases; public String[] verbosePhases;
@Argument(value = "list_phases", prefix = "--", description = "List all backend phases") @Argument(value = "--list_phases", description = "List all backend phases")
public boolean listPhases; public boolean listPhases;
@Argument(value = "time", prefix = "--", description = "Report execution time for compiler phases") @Argument(value = "--time", description = "Report execution time for compiler phases")
public boolean timePhases; public boolean timePhases;
} }
+1 -1
View File
@@ -21,5 +21,5 @@ remoteRoot=konan_tests
#kotlinCompilerModule=org.jetbrains.kotlin:kotlin-compiler:1.1-SNAPSHOT #kotlinCompilerModule=org.jetbrains.kotlin:kotlin-compiler:1.1-SNAPSHOT
# Download artifacts of https://teamcity.jetbrains.com/viewType.html?buildTypeId=bt345 # Download artifacts of https://teamcity.jetbrains.com/viewType.html?buildTypeId=bt345
testDataVersion=1009012:id testDataVersion=1009012:id
kotlinCompilerModule=org.jetbrains.kotlin:kotlin-compiler:1.1-20170414.151645-464 kotlinCompilerModule=org.jetbrains.kotlin:kotlin-compiler:1.1-20170417.154352-466
konanVersion=0.1 konanVersion=0.1