[K/N] Add option to save unoptimized bitcode
Add `-Xsave-llvm-ir` option that stores LLVM IR text into temporary directory right after IrToBitcode translation. This is required for FileCheck-based tests and just helpful during development.
This commit is contained in:
@@ -175,6 +175,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
arguments.manifestFile ?.let{ put(MANIFEST_FILE, it) }
|
||||
arguments.runtimeFile ?.let{ put(RUNTIME_FILE, it) }
|
||||
arguments.temporaryFilesDir?.let { put(TEMPORARY_FILES_DIR, it) }
|
||||
put(SAVE_LLVM_IR, arguments.saveLlvmIr)
|
||||
|
||||
put(LIST_TARGETS, arguments.listTargets)
|
||||
put(OPTIMIZATION, arguments.optimization)
|
||||
|
||||
+3
@@ -255,6 +255,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
||||
@Argument(value = "-Xtemporary-files-dir", deprecatedName = "--temporary_files_dir", valueDescription = "<path>", description = "Save temporary files to the given directory")
|
||||
var temporaryFilesDir: String? = null
|
||||
|
||||
@Argument(value = "-Xsave-llvm-ir", description = "Save result of Kotlin IR to LLVM IR translation to the temporary files directory.")
|
||||
var saveLlvmIr: Boolean = false
|
||||
|
||||
@Argument(value = "-Xverify-bitcode", deprecatedName = "--verify_bitcode", description = "Verify llvm bitcode after each method")
|
||||
var verifyBitCode: Boolean = false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user