File tree 1 file changed +27
-0
lines changed 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -6424,6 +6424,33 @@ fn asmExpr(
6424
6424
// issues and decide how to handle outputs. Do we want this to be identifiers?
6425
6425
// Or maybe we want to force this to be expressions with a pointer type.
6426
6426
// Until that is figured out this is only hooked up for referencing Decls.
6427
+ // TODO we have put this as an identifier lookup just so that we don't get
6428
+ // unused vars for outputs. We need to check if this is correct in the future ^^
6429
+ // so we just put in this simple lookup. This is a workaround.
6430
+ {
6431
+ var s = scope ;
6432
+ while (true ) switch (s .tag ) {
6433
+ .local_val = > {
6434
+ const local_val = s .cast (Scope .LocalVal ).? ;
6435
+ if (local_val .name == str_index ) {
6436
+ local_val .used = true ;
6437
+ break ;
6438
+ }
6439
+ s = local_val .parent ;
6440
+ },
6441
+ .local_ptr = > {
6442
+ const local_ptr = s .cast (Scope .LocalPtr ).? ;
6443
+ if (local_ptr .name == str_index ) {
6444
+ local_ptr .used = true ;
6445
+ break ;
6446
+ }
6447
+ s = local_ptr .parent ;
6448
+ },
6449
+ .gen_zir = > s = s .cast (GenZir ).? .parent ,
6450
+ .defer_normal , .defer_error = > s = s .cast (Scope .Defer ).? .parent ,
6451
+ .namespace , .top = > break ,
6452
+ };
6453
+ }
6427
6454
const operand = try gz .addStrTok (.decl_ref , str_index , ident_token );
6428
6455
outputs [i ] = .{
6429
6456
.name = name ,
You can’t perform that action at this time.
0 commit comments