diff --git a/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/convertors/WasmIrToBinary.kt b/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/convertors/WasmIrToBinary.kt index 564695a2094..3cd8df48c73 100644 --- a/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/convertors/WasmIrToBinary.kt +++ b/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/convertors/WasmIrToBinary.kt @@ -390,7 +390,7 @@ class WasmIrToBinary( } appendType(c.type) b.writeVarUInt1(c.isMutable) - appendExpr(c.init, SourceLocation.TBDLocation) + appendExpr(c.init) } private fun appendTag(t: WasmTag) { @@ -405,9 +405,9 @@ class WasmIrToBinary( b.writeVarUInt32(t.type.id!!) } - private fun appendExpr(expr: Iterable, location: SourceLocation) { + private fun appendExpr(expr: Iterable) { expr.forEach { appendInstr(it) } - appendInstr(WasmInstrWithLocation(WasmOp.END, location)) + appendInstr(WasmInstrWithLocation(WasmOp.END, SourceLocation.NoLocation("End of instruction list"))) } private fun appendExport(export: WasmExport<*>) { @@ -433,7 +433,7 @@ class WasmIrToBinary( funcIndices.forEach { b.writeVarUInt32(it) } } else { element.values.forEach { - appendExpr((it as WasmTable.Value.Expression).expr, SourceLocation.TBDLocation) + appendExpr((it as WasmTable.Value.Expression).expr) } } } @@ -457,18 +457,18 @@ class WasmIrToBinary( when { tableId == 0 && isFuncIndices -> { b.writeByte(0x0) - appendExpr(mode.offset, SourceLocation.TBDLocation) + appendExpr(mode.offset) } isFuncIndices -> { b.writeByte(0x2) appendModuleFieldReference(mode.table) - appendExpr(mode.offset, SourceLocation.TBDLocation) + appendExpr(mode.offset) writeTypeOrKind() } else -> { b.writeByte(0x6) appendModuleFieldReference(mode.table) - appendExpr(mode.offset, SourceLocation.TBDLocation) + appendExpr(mode.offset) writeTypeOrKind() } } @@ -492,7 +492,7 @@ class WasmIrToBinary( } } - appendExpr(function.instructions, SourceLocation.TBDLocation) + appendExpr(function.instructions) } } @@ -505,7 +505,7 @@ class WasmIrToBinary( b.writeByte(2) b.writeVarUInt32(mode.memoryIdx) } - appendExpr(mode.offset, SourceLocation.TBDLocation) + appendExpr(mode.offset) } WasmDataMode.Passive -> b.writeByte(1) } diff --git a/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/source/location/LocationHolder.kt b/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/source/location/LocationHolder.kt index 819b484094c..46d9b15da9a 100644 --- a/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/source/location/LocationHolder.kt +++ b/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/source/location/LocationHolder.kt @@ -11,5 +11,3 @@ value class LocationHolder(val location: SourceLocation) inline fun withLocation(location: SourceLocation, body: LocationHolder.() -> R): R = LocationHolder(location).body() inline fun withNoLocation(description: String, body: LocationHolder.() -> R): R = withLocation(SourceLocation.NoLocation(description), body) - -inline fun withTBDLocation(body: LocationHolder.() -> R): R = withLocation(SourceLocation.TBDLocation, body) diff --git a/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/source/location/SourceLocation.kt b/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/source/location/SourceLocation.kt index a7c3c3edb8d..fd43bc85b41 100644 --- a/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/source/location/SourceLocation.kt +++ b/wasm/wasm.ir/src/org/jetbrains/kotlin/wasm/ir/source/location/SourceLocation.kt @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.wasm.ir.source.location sealed class SourceLocation { private object NoLocation : SourceLocation() - object TBDLocation : SourceLocation() data class Location(val file: String, val line: Int, val column: Int) : SourceLocation()