style: compact inner groups and simple guard bodies
This commit is contained in:
@@ -201,9 +201,8 @@ emit_instruction proc(state @mut State, block @ir.Block, instruction ir.Instruct
|
||||
.optional_check: {
|
||||
operand :: try load(state, instruction.left)
|
||||
failed :: fresh(state)
|
||||
if (state.values[usize(instruction.left)].kind == .bool) {
|
||||
try io.print(" %r{} = xor i1 %r{}, true\n", output, {failed, operand})
|
||||
} else try io.print(" %r{} = icmp eq ptr %r{}, null\n", output, {failed, operand})
|
||||
if (state.values[usize(instruction.left)].kind == .bool) try io.print(" %r{} = xor i1 %r{}, true\n", output, {failed, operand})
|
||||
else try io.print(" %r{} = icmp eq ptr %r{}, null\n", output, {failed, operand})
|
||||
try check_failure(state, failed, .null_unwrap, instruction.span)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -104,9 +104,7 @@ emit proc(
|
||||
mem.set(values, Type{})
|
||||
for (function.blocks.items) |block| {
|
||||
for (block.instructions.items) |instruction| {
|
||||
if (instruction.destination != ir.no_value) {
|
||||
values[usize(instruction.destination)] = Type{ kind = instruction.type, shape = instruction.array_type }
|
||||
}
|
||||
if (instruction.destination != ir.no_value) values[usize(instruction.destination)] = Type{ kind = instruction.type, shape = instruction.array_type }
|
||||
}
|
||||
}
|
||||
state := State{ output = output, module = module, line_starts = line_starts.items, values = values }
|
||||
|
||||
Reference in New Issue
Block a user