[Wasm] Add a basic end-to-end sourcemap generation in wasm backend

More constructions/instructions will be supported separately.
This commit is contained in:
Zalim Bashorov
2022-12-06 16:19:59 +01:00
committed by teamcity
parent 1c4614e93b
commit 49c3ba33f1
14 changed files with 250 additions and 42 deletions
@@ -367,18 +367,23 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
if (arguments.irDce) {
eliminateDeadDeclarations(allModules, backendContext)
}
val sourceMapFileName = if (configuration.getBoolean(JSConfigurationKeys.SOURCE_MAP)) "$outputName.map" else null
val res = compileWasm(
allModules = allModules,
backendContext = backendContext,
emitNameSection = arguments.wasmDebug,
allowIncompleteImplementations = arguments.irDce,
generateWat = true,
sourceMapFileName = sourceMapFileName
)
writeCompilationResult(
result = res,
dir = outputDir,
fileNameBase = outputName
fileNameBase = outputName,
sourceMapFileName = sourceMapFileName
)
return OK