| ... | @@ -152,6 +152,8 @@ needs_mem_loc: MemLocRequirement = .never, | ... | @@ -152,6 +152,8 @@ needs_mem_loc: MemLocRequirement = .never, |
| 152 | eval_to_error: EvalToError = .never, | 152 | eval_to_error: EvalToError = .never, |
| 153 | /// `true` if the builtin call can be the left-hand side of an expression (assigned to). | 153 | /// `true` if the builtin call can be the left-hand side of an expression (assigned to). |
| 154 | allows_lvalue: bool = false, | 154 | allows_lvalue: bool = false, |
| | 155 | /// `true` if builtin call is not available outside function scope |
| | 156 | illegal_outside_function: bool = false, |
| 155 | /// The number of parameters to this builtin function. `null` means variable number | 157 | /// The number of parameters to this builtin function. `null` means variable number |
| 156 | /// of parameters. | 158 | /// of parameters. |
| 157 | param_count: ?u8, | 159 | param_count: ?u8, |
| ... | @@ -258,6 +260,7 @@ pub const list = list: { | ... | @@ -258,6 +260,7 @@ pub const list = list: { |
| 258 | .{ | 260 | .{ |
| 259 | .tag = .breakpoint, | 261 | .tag = .breakpoint, |
| 260 | .param_count = 0, | 262 | .param_count = 0, |
| | 263 | .illegal_outside_function = true, |
| 261 | }, | 264 | }, |
| 262 | }, | 265 | }, |
| 263 | .{ | 266 | .{ |
| ... | @@ -378,24 +381,28 @@ pub const list = list: { | ... | @@ -378,24 +381,28 @@ pub const list = list: { |
| 378 | "@cVaArg", .{ | 381 | "@cVaArg", .{ |
| 379 | .tag = .c_va_arg, | 382 | .tag = .c_va_arg, |
| 380 | .param_count = 2, | 383 | .param_count = 2, |
| | 384 | .illegal_outside_function = true, |
| 381 | }, | 385 | }, |
| 382 | }, | 386 | }, |
| 383 | .{ | 387 | .{ |
| 384 | "@cVaCopy", .{ | 388 | "@cVaCopy", .{ |
| 385 | .tag = .c_va_copy, | 389 | .tag = .c_va_copy, |
| 386 | .param_count = 1, | 390 | .param_count = 1, |
| | 391 | .illegal_outside_function = true, |
| 387 | }, | 392 | }, |
| 388 | }, | 393 | }, |
| 389 | .{ | 394 | .{ |
| 390 | "@cVaEnd", .{ | 395 | "@cVaEnd", .{ |
| 391 | .tag = .c_va_end, | 396 | .tag = .c_va_end, |
| 392 | .param_count = 1, | 397 | .param_count = 1, |
| | 398 | .illegal_outside_function = true, |
| 393 | }, | 399 | }, |
| 394 | }, | 400 | }, |
| 395 | .{ | 401 | .{ |
| 396 | "@cVaStart", .{ | 402 | "@cVaStart", .{ |
| 397 | .tag = .c_va_start, | 403 | .tag = .c_va_start, |
| 398 | .param_count = 0, | 404 | .param_count = 0, |
| | 405 | .illegal_outside_function = true, |
| 399 | }, | 406 | }, |
| 400 | }, | 407 | }, |
| 401 | .{ | 408 | .{ |
| ... | @@ -533,6 +540,7 @@ pub const list = list: { | ... | @@ -533,6 +540,7 @@ pub const list = list: { |
| 533 | .{ | 540 | .{ |
| 534 | .tag = .frame_address, | 541 | .tag = .frame_address, |
| 535 | .param_count = 0, | 542 | .param_count = 0, |
| | 543 | .illegal_outside_function = true, |
| 536 | }, | 544 | }, |
| 537 | }, | 545 | }, |
| 538 | .{ | 546 | .{ |
| ... | @@ -709,6 +717,7 @@ pub const list = list: { | ... | @@ -709,6 +717,7 @@ pub const list = list: { |
| 709 | .{ | 717 | .{ |
| 710 | .tag = .return_address, | 718 | .tag = .return_address, |
| 711 | .param_count = 0, | 719 | .param_count = 0, |
| | 720 | .illegal_outside_function = true, |
| 712 | }, | 721 | }, |
| 713 | }, | 722 | }, |
| 714 | .{ | 723 | .{ |
| ... | @@ -723,6 +732,7 @@ pub const list = list: { | ... | @@ -723,6 +732,7 @@ pub const list = list: { |
| 723 | .{ | 732 | .{ |
| 724 | .tag = .set_align_stack, | 733 | .tag = .set_align_stack, |
| 725 | .param_count = 1, | 734 | .param_count = 1, |
| | 735 | .illegal_outside_function = true, |
| 726 | }, | 736 | }, |
| 727 | }, | 737 | }, |
| 728 | .{ | 738 | .{ |
| ... | @@ -730,6 +740,7 @@ pub const list = list: { | ... | @@ -730,6 +740,7 @@ pub const list = list: { |
| 730 | .{ | 740 | .{ |
| 731 | .tag = .set_cold, | 741 | .tag = .set_cold, |
| 732 | .param_count = 1, | 742 | .param_count = 1, |
| | 743 | .illegal_outside_function = true, |
| 733 | }, | 744 | }, |
| 734 | }, | 745 | }, |
| 735 | .{ | 746 | .{ |
| ... | @@ -808,6 +819,7 @@ pub const list = list: { | ... | @@ -808,6 +819,7 @@ pub const list = list: { |
| 808 | .tag = .src, | 819 | .tag = .src, |
| 809 | .needs_mem_loc = .always, | 820 | .needs_mem_loc = .always, |
| 810 | .param_count = 0, | 821 | .param_count = 0, |
| | 822 | .illegal_outside_function = true, |
| 811 | }, | 823 | }, |
| 812 | }, | 824 | }, |
| 813 | .{ | 825 | .{ |
| ... | @@ -997,6 +1009,7 @@ pub const list = list: { | ... | @@ -997,6 +1009,7 @@ pub const list = list: { |
| 997 | "@workItemId", .{ | 1009 | "@workItemId", .{ |
| 998 | .tag = .work_item_id, | 1010 | .tag = .work_item_id, |
| 999 | .param_count = 1, | 1011 | .param_count = 1, |
| | 1012 | .illegal_outside_function = true, |
| 1000 | }, | 1013 | }, |
| 1001 | }, | 1014 | }, |
| 1002 | .{ | 1015 | .{ |
| ... | @@ -1004,6 +1017,7 @@ pub const list = list: { | ... | @@ -1004,6 +1017,7 @@ pub const list = list: { |
| 1004 | .{ | 1017 | .{ |
| 1005 | .tag = .work_group_size, | 1018 | .tag = .work_group_size, |
| 1006 | .param_count = 1, | 1019 | .param_count = 1, |
| | 1020 | .illegal_outside_function = true, |
| 1007 | }, | 1021 | }, |
| 1008 | }, | 1022 | }, |
| 1009 | .{ | 1023 | .{ |
| ... | @@ -1011,6 +1025,7 @@ pub const list = list: { | ... | @@ -1011,6 +1025,7 @@ pub const list = list: { |
| 1011 | .{ | 1025 | .{ |
| 1012 | .tag = .work_group_id, | 1026 | .tag = .work_group_id, |
| 1013 | .param_count = 1, | 1027 | .param_count = 1, |
| | 1028 | .illegal_outside_function = true, |
| 1014 | }, | 1029 | }, |
| 1015 | }, | 1030 | }, |
| 1016 | }); | 1031 | }); |