[Wasm] Introduce Xwasm-generate-wat compiler flag (disabled by default)
This commit is contained in:
+3
@@ -336,6 +336,9 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
@Argument(value = "-Xwasm-enable-asserts", description = "Turn on asserts")
|
||||
var wasmEnableAsserts: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(value = "-Xwasm-generate-wat", description = "Generate wat file")
|
||||
var wasmGenerateWat: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xuse-deprecated-legacy-compiler",
|
||||
description = "Use deprecated legacy compiler without error"
|
||||
|
||||
@@ -200,6 +200,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
|
||||
configuration.put(JSConfigurationKeys.WASM_ENABLE_ARRAY_RANGE_CHECKS, arguments.wasmEnableArrayRangeChecks)
|
||||
configuration.put(JSConfigurationKeys.WASM_ENABLE_ASSERTS, arguments.wasmEnableAsserts)
|
||||
configuration.put(JSConfigurationKeys.WASM_GENERATE_WAT, arguments.wasmGenerateWat)
|
||||
|
||||
val commonSourcesArray = arguments.commonSources
|
||||
val commonSources = commonSourcesArray?.toSet() ?: emptySet()
|
||||
@@ -376,7 +377,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
baseFileName = outputName,
|
||||
emitNameSection = arguments.wasmDebug,
|
||||
allowIncompleteImplementations = arguments.irDce,
|
||||
generateWat = true,
|
||||
generateWat = configuration.get(JSConfigurationKeys.WASM_GENERATE_WAT, false),
|
||||
generateSourceMaps = generateSourceMaps
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user