diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-08-03 19:55:27 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-08-09 11:59:10 +0300 |
| commit | c76b5c1a31ebe09726cd29e7a6da69613eabfd10 (patch) | |
| tree | bb714ca03635ecf990829cf6d2a5e31a8de203db /src/type.zig | |
| parent | d769fd0102dee7ea24f957c3c96e2336d1c18839 (diff) | |
| download | zig-c76b5c1a31ebe09726cd29e7a6da69613eabfd10.tar.gz zig-c76b5c1a31ebe09726cd29e7a6da69613eabfd10.zip | |
stage2: correct node offset of nested declarations
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/type.zig b/src/type.zig index d53158735a..85d77303c9 100644 --- a/src/type.zig +++ b/src/type.zig @@ -5771,50 +5771,6 @@ pub const Type = extern union { } } - pub fn getNodeOffset(ty: Type) i32 { - switch (ty.tag()) { - .enum_full, .enum_nonexhaustive => { - const enum_full = ty.cast(Payload.EnumFull).?.data; - return enum_full.node_offset; - }, - .enum_numbered => return ty.castTag(.enum_numbered).?.data.node_offset, - .enum_simple => { - const enum_simple = ty.castTag(.enum_simple).?.data; - return enum_simple.node_offset; - }, - .@"struct" => { - const struct_obj = ty.castTag(.@"struct").?.data; - return struct_obj.node_offset; - }, - .error_set => { - const error_set = ty.castTag(.error_set).?.data; - return error_set.node_offset; - }, - .@"union", .union_safety_tagged, .union_tagged => { - const union_obj = ty.cast(Payload.Union).?.data; - return union_obj.node_offset; - }, - .@"opaque" => { - const opaque_obj = ty.cast(Payload.Opaque).?.data; - return opaque_obj.node_offset; - }, - .atomic_order, - .atomic_rmw_op, - .calling_convention, - .address_space, - .float_mode, - .reduce_op, - .call_options, - .prefetch_options, - .export_options, - .extern_options, - .type_info, - => unreachable, // These need to be resolved earlier. - - else => unreachable, - } - } - /// This enum does not directly correspond to `std.builtin.TypeId` because /// it has extra enum tags in it, as a way of using less memory. For example, /// even though Zig recognizes `*align(10) i32` and `*i32` both as Pointer types |
