| ... | ... | @@ -1293,6 +1293,50 @@ fn walkInstruction( |
| 1293 | 1293 | .expr = .{ .binOpIndex = binop_index }, |
| 1294 | 1294 | }; |
| 1295 | 1295 | }, |
| 1296 | // compare operators |
| 1297 | .cmp_eq, |
| 1298 | .cmp_neq, |
| 1299 | .cmp_gt, |
| 1300 | .cmp_gte, |
| 1301 | .cmp_lt, |
| 1302 | .cmp_lte, |
| 1303 | => { |
| 1304 | const pl_node = data[inst_index].pl_node; |
| 1305 | const extra = file.zir.extraData(Zir.Inst.Bin, pl_node.payload_index); |
| 1306 | |
| 1307 | const binop_index = self.exprs.items.len; |
| 1308 | try self.exprs.append(self.arena, .{ .binOp = .{ .lhs = 0, .rhs = 0 } }); |
| 1309 | |
| 1310 | var lhs: DocData.WalkResult = try self.walkRef( |
| 1311 | file, |
| 1312 | parent_scope, |
| 1313 | parent_line, |
| 1314 | extra.data.lhs, |
| 1315 | false, |
| 1316 | ); |
| 1317 | var rhs: DocData.WalkResult = try self.walkRef( |
| 1318 | file, |
| 1319 | parent_scope, |
| 1320 | parent_line, |
| 1321 | extra.data.rhs, |
| 1322 | false, |
| 1323 | ); |
| 1324 | |
| 1325 | const lhs_index = self.exprs.items.len; |
| 1326 | try self.exprs.append(self.arena, lhs.expr); |
| 1327 | const rhs_index = self.exprs.items.len; |
| 1328 | try self.exprs.append(self.arena, rhs.expr); |
| 1329 | self.exprs.items[binop_index] = .{ .binOp = .{ |
| 1330 | .name = @tagName(tags[inst_index]), |
| 1331 | .lhs = lhs_index, |
| 1332 | .rhs = rhs_index, |
| 1333 | } }; |
| 1334 | |
| 1335 | return DocData.WalkResult{ |
| 1336 | .typeRef = .{ .type = @enumToInt(Ref.bool_type) }, |
| 1337 | .expr = .{ .binOpIndex = binop_index }, |
| 1338 | }; |
| 1339 | }, |
| 1296 | 1340 | |
| 1297 | 1341 | // builtin functions |
| 1298 | 1342 | .align_of, |