| ... | @@ -1251,6 +1251,37 @@ fn walkInstruction( | ... | @@ -1251,6 +1251,37 @@ fn walkInstruction( |
| 1251 | }; | 1251 | }; |
| 1252 | }, | 1252 | }, |
| 1253 | | 1253 | |
| | 1254 | .div => { |
| | 1255 | const pl_node = data[inst_index].pl_node; |
| | 1256 | const extra = file.zir.extraData(Zir.Inst.Bin, pl_node.payload_index); |
| | 1257 | |
| | 1258 | const binop_index = self.exprs.items.len; |
| | 1259 | try self.exprs.append(self.arena, .{ .binOp = .{ .lhs = 0, .rhs = 0 } }); |
| | 1260 | |
| | 1261 | var lhs: DocData.WalkResult = try self.walkRef( |
| | 1262 | file, |
| | 1263 | parent_scope, |
| | 1264 | extra.data.lhs, |
| | 1265 | false, |
| | 1266 | ); |
| | 1267 | var rhs: DocData.WalkResult = try self.walkRef( |
| | 1268 | file, |
| | 1269 | parent_scope, |
| | 1270 | extra.data.rhs, |
| | 1271 | false, |
| | 1272 | ); |
| | 1273 | |
| | 1274 | const lhs_index = self.exprs.items.len; |
| | 1275 | try self.exprs.append(self.arena, lhs.expr); |
| | 1276 | const rhs_index = self.exprs.items.len; |
| | 1277 | try self.exprs.append(self.arena, rhs.expr); |
| | 1278 | self.exprs.items[binop_index] = .{ .binOp = .{ .lhs = lhs_index, .rhs = rhs_index, .opKind = 3 } }; |
| | 1279 | |
| | 1280 | return DocData.WalkResult{ |
| | 1281 | .typeRef = .{ .type = @enumToInt(Ref.type_type) }, |
| | 1282 | .expr = .{ .binOpIndex = binop_index }, |
| | 1283 | }; |
| | 1284 | }, |
| 1254 | .div_exact => { | 1285 | .div_exact => { |
| 1255 | const pl_node = data[inst_index].pl_node; | 1286 | const pl_node = data[inst_index].pl_node; |
| 1256 | const extra = file.zir.extraData(Zir.Inst.Bin, pl_node.payload_index); | 1287 | const extra = file.zir.extraData(Zir.Inst.Bin, pl_node.payload_index); |