Skip to content

Commit eda1d51

Browse files
./Utilities/format.py
1 parent 6bac413 commit eda1d51

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Sources/WasmKit/Translator.swift

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,7 @@ struct InstructionTranslator<Context: TranslatorContext>: InstructionVisitor {
17371737
emit(instruction(storeOperand))
17381738
}
17391739
}
1740-
1740+
17411741
mutating func visitLoad(_ load: WasmParser.Instruction.Load, memarg: MemArg) throws {
17421742
let instruction: (Instruction.LoadOperand) -> Instruction
17431743
switch load {
@@ -1758,7 +1758,7 @@ struct InstructionTranslator<Context: TranslatorContext>: InstructionVisitor {
17581758
}
17591759
try visitLoad(memarg, load.type, load.naturalAlignment, instruction)
17601760
}
1761-
1761+
17621762
mutating func visitStore(_ store: WasmParser.Instruction.Store, memarg: MemArg) throws {
17631763
let instruction: (Instruction.StoreOperand) -> Instruction
17641764
switch store {
@@ -1860,7 +1860,8 @@ struct InstructionTranslator<Context: TranslatorContext>: InstructionVisitor {
18601860
}
18611861
}
18621862
mutating func visitCmp(_ cmp: WasmParser.Instruction.Cmp) throws {
1863-
let operand: ValueType, instruction: (Instruction.BinaryOperand) -> Instruction
1863+
let operand: ValueType
1864+
let instruction: (Instruction.BinaryOperand) -> Instruction
18641865
switch cmp {
18651866
case .i32Eq: (operand, instruction) = (.i32, Instruction.i32Eq)
18661867
case .i32Ne: (operand, instruction) = (.i32, Instruction.i32Ne)
@@ -1898,7 +1899,9 @@ struct InstructionTranslator<Context: TranslatorContext>: InstructionVisitor {
18981899
try visitCmp(operand, instruction)
18991900
}
19001901
public mutating func visitBinary(_ binary: WasmParser.Instruction.Binary) throws {
1901-
let operand: ValueType, result: ValueType, instruction: (Instruction.BinaryOperand) -> Instruction
1902+
let operand: ValueType
1903+
let result: ValueType
1904+
let instruction: (Instruction.BinaryOperand) -> Instruction
19021905
switch binary {
19031906
case .i32Add: (operand, result, instruction) = (.i32, .i32, Instruction.i32Add)
19041907
case .i32Sub: (operand, result, instruction) = (.i32, .i32, Instruction.i32Sub)
@@ -1945,15 +1948,16 @@ struct InstructionTranslator<Context: TranslatorContext>: InstructionVisitor {
19451948
case .f64Max: (operand, result, instruction) = (.f64, .f64, Instruction.f64Max)
19461949
case .f64Copysign: (operand, result, instruction) = (.f64, .f64, Instruction.f64CopySign)
19471950
}
1948-
try visitBinary(operand, result, instruction)
1951+
try visitBinary(operand, result, instruction)
19491952
}
19501953
mutating func visitI64Eqz() throws -> Output {
19511954
try popPushEmit(.i64, .i32) { value, result, stack in
19521955
.i64Eqz(Instruction.UnaryOperand(result: LVReg(result), input: LVReg(value)))
19531956
}
19541957
}
19551958
mutating func visitUnary(_ unary: WasmParser.Instruction.Unary) throws {
1956-
let operand: ValueType, instruction: (Instruction.UnaryOperand) -> Instruction
1959+
let operand: ValueType
1960+
let instruction: (Instruction.UnaryOperand) -> Instruction
19571961
switch unary {
19581962
case .i32Clz: (operand, instruction) = (.i32, Instruction.i32Clz)
19591963
case .i32Ctz: (operand, instruction) = (.i32, Instruction.i32Ctz)
@@ -1984,7 +1988,9 @@ struct InstructionTranslator<Context: TranslatorContext>: InstructionVisitor {
19841988
try visitUnary(operand, instruction)
19851989
}
19861990
mutating func visitConversion(_ conversion: WasmParser.Instruction.Conversion) throws {
1987-
let from: ValueType, to: ValueType, instruction: (Instruction.UnaryOperand) -> Instruction
1991+
let from: ValueType
1992+
let to: ValueType
1993+
let instruction: (Instruction.UnaryOperand) -> Instruction
19881994
switch conversion {
19891995
case .i32WrapI64: (from, to, instruction) = (.i64, .i32, Instruction.i32WrapI64)
19901996
case .i32TruncF32S: (from, to, instruction) = (.f32, .i32, Instruction.i32TruncF32S)

0 commit comments

Comments
 (0)