diff options
| author | Veikka Tuominen <git@vexu.eu> | 2021-02-01 15:45:11 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-02-01 15:45:11 +0200 |
| commit | 75acfcf0eaa306b3a8872e50cb735e1d5eb18c52 (patch) | |
| tree | ff80058a12bedc0d9806a37047becd484f102faf /src/codegen/c.zig | |
| parent | 3ec5c9a3bcae09c01cbe4f0505e6ab03834bbb98 (diff) | |
| download | zig-75acfcf0eaa306b3a8872e50cb735e1d5eb18c52.tar.gz zig-75acfcf0eaa306b3a8872e50cb735e1d5eb18c52.zip | |
stage2: reimplement switch
Diffstat (limited to 'src/codegen/c.zig')
| -rw-r--r-- | src/codegen/c.zig | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 39fa80ea3d..cb3271a57f 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -414,11 +414,13 @@ pub fn genBody(o: *Object, body: ir.Body) error{ AnalysisFail, OutOfMemory }!voi .loop => try genLoop(o, inst.castTag(.loop).?), .condbr => try genCondBr(o, inst.castTag(.condbr).?), .br => try genBr(o, inst.castTag(.br).?), - .brvoid => try genBrVoid(o, inst.castTag(.brvoid).?.block), + .br_void => try genBrVoid(o, inst.castTag(.br_void).?.block), .switchbr => try genSwitchBr(o, inst.castTag(.switchbr).?), - // booland and boolor are non-short-circuit operations - .booland, .bitand => try genBinOp(o, inst.castTag(.booland).?, " & "), - .boolor, .bitor => try genBinOp(o, inst.castTag(.boolor).?, " | "), + // bool_and and bool_or are non-short-circuit operations + .bool_and => try genBinOp(o, inst.castTag(.bool_and).?, " & "), + .bool_or => try genBinOp(o, inst.castTag(.bool_or).?, " | "), + .bit_and => try genBinOp(o, inst.castTag(.bit_and).?, " & "), + .bit_or => try genBinOp(o, inst.castTag(.bit_or).?, " | "), .xor => try genBinOp(o, inst.castTag(.xor).?, " ^ "), .not => try genUnOp(o, inst.castTag(.not).?, "!"), else => |e| return o.dg.fail(o.dg.decl.src(), "TODO: C backend: implement codegen for {}", .{e}), |
