[Wasm] Require location for buildConstI32 and fix all usages

This commit is contained in:
Zalim Bashorov
2022-12-06 20:34:47 +01:00
parent cdc1d66b1f
commit f2f4c63720
6 changed files with 147 additions and 127 deletions
@@ -65,8 +65,8 @@ sealed class WasmDataMode {
val memoryIdx: Int,
val offset: MutableList<WasmInstr>
) : WasmDataMode() {
constructor(memoryIdx: Int, offset: Int) : this(memoryIdx, mutableListOf<WasmInstr>().also<MutableList<WasmInstr>> {
WasmIrExpressionBuilder(it).buildConstI32(offset)
constructor(memoryIdx: Int, offset: Int, location: SourceLocation) : this(memoryIdx, mutableListOf<WasmInstr>().also<MutableList<WasmInstr>> {
WasmIrExpressionBuilder(it).buildConstI32(offset, location)
})
}
@@ -16,7 +16,7 @@ abstract class WasmExpressionBuilder {
abstract var numberOfNestedBlocks: Int
fun buildConstI32(value: Int, location: SourceLocation = SourceLocation.TBDLocation) {
fun buildConstI32(value: Int, location: SourceLocation) {
buildInstr(WasmOp.I32_CONST, location, WasmImmediate.ConstI32(value))
}