diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-04-07 13:16:36 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-04-07 13:17:23 -0700 |
| commit | 015599d1ef1606e56c49118800a4c7ef36c038e6 (patch) | |
| tree | 345ea153b49edb87320966c5b9d8a9732993b472 | |
| parent | 090834380cff9f2743f9c71e8e141ac5aceb747e (diff) | |
| download | zig-015599d1ef1606e56c49118800a4c7ef36c038e6.tar.gz zig-015599d1ef1606e56c49118800a4c7ef36c038e6.zip | |
C backend: enumerate all the types in renderType
Now that we're close to supporting all the types, get rid of the `else`
prong and explicitly list out those types that are not yet implemented.
Thanks @g-w1
| -rw-r--r-- | src/codegen/c.zig | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index d5d18baa1c..874baccf42 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -396,6 +396,9 @@ pub const DeclGen = struct { else => unreachable, } }, + + .Float => return dg.fail(.{ .node_offset = 0 }, "TODO: C backend: implement type Float", .{}), + .Pointer => { if (t.isSlice()) { return dg.fail(.{ .node_offset = 0 }, "TODO: C backend: implement slices", .{}); @@ -507,10 +510,22 @@ pub const DeclGen = struct { try dg.renderType(w, int_tag_ty); }, - .Null, .Undefined => unreachable, // must be const or comptime - else => |e| return dg.fail(.{ .node_offset = 0 }, "TODO: C backend: implement type {s}", .{ - @tagName(e), - }), + .Union => return dg.fail(.{ .node_offset = 0 }, "TODO: C backend: implement type Union", .{}), + .Fn => return dg.fail(.{ .node_offset = 0 }, "TODO: C backend: implement type Fn", .{}), + .Opaque => return dg.fail(.{ .node_offset = 0 }, "TODO: C backend: implement type Opaque", .{}), + .Frame => return dg.fail(.{ .node_offset = 0 }, "TODO: C backend: implement type Frame", .{}), + .AnyFrame => return dg.fail(.{ .node_offset = 0 }, "TODO: C backend: implement type AnyFrame", .{}), + .Vector => return dg.fail(.{ .node_offset = 0 }, "TODO: C backend: implement type Vector", .{}), + + .Null, + .Undefined, + .EnumLiteral, + .ComptimeFloat, + .ComptimeInt, + .Type, + => unreachable, // must be const or comptime + + .BoundFn => unreachable, // this type will be deleted from the language } } |
