| ... | ... | @@ -6472,6 +6472,33 @@ fn asmExpr( |
| 6472 | 6472 | // issues and decide how to handle outputs. Do we want this to be identifiers? |
| 6473 | 6473 | // Or maybe we want to force this to be expressions with a pointer type. |
| 6474 | 6474 | // Until that is figured out this is only hooked up for referencing Decls. |
| 6475 | // TODO we have put this as an identifier lookup just so that we don't get |
| 6476 | // unused vars for outputs. We need to check if this is correct in the future ^^ |
| 6477 | // so we just put in this simple lookup. This is a workaround. |
| 6478 | { |
| 6479 | var s = scope; |
| 6480 | while (true) switch (s.tag) { |
| 6481 | .local_val => { |
| 6482 | const local_val = s.cast(Scope.LocalVal).?; |
| 6483 | if (local_val.name == str_index) { |
| 6484 | local_val.used = true; |
| 6485 | break; |
| 6486 | } |
| 6487 | s = local_val.parent; |
| 6488 | }, |
| 6489 | .local_ptr => { |
| 6490 | const local_ptr = s.cast(Scope.LocalPtr).?; |
| 6491 | if (local_ptr.name == str_index) { |
| 6492 | local_ptr.used = true; |
| 6493 | break; |
| 6494 | } |
| 6495 | s = local_ptr.parent; |
| 6496 | }, |
| 6497 | .gen_zir => s = s.cast(GenZir).?.parent, |
| 6498 | .defer_normal, .defer_error => s = s.cast(Scope.Defer).?.parent, |
| 6499 | .namespace, .top => break, |
| 6500 | }; |
| 6501 | } |
| 6475 | 6502 | const operand = try gz.addStrTok(.decl_ref, str_index, ident_token); |
| 6476 | 6503 | outputs[i] = .{ |
| 6477 | 6504 | .name = name, |