authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-03 18:47:53-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-03 18:47:53-07:00
log69d18ad7f05f093b06388877aa4a7b3d6f2664a6
treed781c933e4f6264d369fca85bf2de7dfa68bd404
parent95b014caeaef6b04dc83b85e5b16823520072b44

ZIR: typeof uses the un_node field not un_tok


2 files changed, 3 insertions(+), 3 deletions(-)

src/Sema.zig+1-1
...@@ -4614,7 +4614,7 @@ fn zirTypeInfo(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerErro...@@ -4614,7 +4614,7 @@ fn zirTypeInfo(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerErro
4614}4614}
46154615
4616fn zirTypeof(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst {4616fn zirTypeof(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst {
4617 const inst_data = sema.code.instructions.items(.data)[inst].un_tok;4617 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
4618 const src = inst_data.src();4618 const src = inst_data.src();
4619 const operand = try sema.resolveInst(inst_data.operand);4619 const operand = try sema.resolveInst(inst_data.operand);
4620 return sema.mod.constType(sema.arena, src, operand.ty);4620 return sema.mod.constType(sema.arena, src, operand.ty);
src/Zir.zig+2-2
...@@ -523,7 +523,7 @@ pub const Inst = struct {...@@ -523,7 +523,7 @@ pub const Inst = struct {
523 /// Uses `un_node`.523 /// Uses `un_node`.
524 negate_wrap,524 negate_wrap,
525 /// Returns the type of a value.525 /// Returns the type of a value.
526 /// Uses the `un_tok` field.526 /// Uses the `un_node` field.
527 typeof,527 typeof,
528 /// Given a value which is a pointer, returns the element type.528 /// Given a value which is a pointer, returns the element type.
529 /// Uses the `un_node` field.529 /// Uses the `un_node` field.
...@@ -1334,7 +1334,7 @@ pub const Inst = struct {...@@ -1334,7 +1334,7 @@ pub const Inst = struct {
1334 .subwrap = .pl_node,1334 .subwrap = .pl_node,
1335 .negate = .un_node,1335 .negate = .un_node,
1336 .negate_wrap = .un_node,1336 .negate_wrap = .un_node,
1337 .typeof = .un_tok,1337 .typeof = .un_node,
1338 .typeof_elem = .un_node,1338 .typeof_elem = .un_node,
1339 .typeof_log2_int_type = .un_node,1339 .typeof_log2_int_type = .un_node,
1340 .log2_int_type = .un_node,1340 .log2_int_type = .un_node,