| author | |
| committer | |
| log | 6b98384e20e738dceabaad38dab1be12375f2a3d |
| tree | c6836eb784d8c07e177f98ee8503b179236c2b65 |
| parent | fbfae832eaf520f7fcc632580b4b4a7fb171f90f |
clearing up some enum tag space for future added instructions3 files changed, 6 insertions(+), 37 deletions(-)
src/AstGen.zig-3| ... | ... | @@ -1825,7 +1825,6 @@ fn unusedResultExpr(gz: *GenZir, scope: *Scope, statement: ast.Node.Index) Inner |
| 1825 | 1825 | .int_big, |
| 1826 | 1826 | .float, |
| 1827 | 1827 | .float128, |
| 1828 | .intcast, | |
| 1829 | 1828 | .int_type, |
| 1830 | 1829 | .is_non_null, |
| 1831 | 1830 | .is_null, |
| ... | ... | @@ -1837,7 +1836,6 @@ fn unusedResultExpr(gz: *GenZir, scope: *Scope, statement: ast.Node.Index) Inner |
| 1837 | 1836 | .mul, |
| 1838 | 1837 | .mulwrap, |
| 1839 | 1838 | .param_type, |
| 1840 | .ptrtoint, | |
| 1841 | 1839 | .ref, |
| 1842 | 1840 | .shl, |
| 1843 | 1841 | .shr, |
| ... | ... | @@ -2004,7 +2002,6 @@ fn unusedResultExpr(gz: *GenZir, scope: *Scope, statement: ast.Node.Index) Inner |
| 2004 | 2002 | .condbr_inline, |
| 2005 | 2003 | .compile_error, |
| 2006 | 2004 | .ret_node, |
| 2007 | .ret_tok, | |
| 2008 | 2005 | .ret_coerce, |
| 2009 | 2006 | .@"unreachable", |
| 2010 | 2007 | .store, |
src/Sema.zig+2-17| ... | ... | @@ -206,7 +206,6 @@ pub fn analyzeBody( |
| 206 | 206 | .float => try sema.zirFloat(block, inst), |
| 207 | 207 | .float128 => try sema.zirFloat128(block, inst), |
| 208 | 208 | .int_type => try sema.zirIntType(block, inst), |
| 209 | .intcast => try sema.zirIntcast(block, inst), | |
| 210 | 209 | .is_err => try sema.zirIsErr(block, inst), |
| 211 | 210 | .is_err_ptr => try sema.zirIsErrPtr(block, inst), |
| 212 | 211 | .is_non_null => try sema.zirIsNull(block, inst, true), |
| ... | ... | @@ -225,7 +224,6 @@ pub fn analyzeBody( |
| 225 | 224 | .param_type => try sema.zirParamType(block, inst), |
| 226 | 225 | .ptr_type => try sema.zirPtrType(block, inst), |
| 227 | 226 | .ptr_type_simple => try sema.zirPtrTypeSimple(block, inst), |
| 228 | .ptrtoint => try sema.zirPtrtoint(block, inst), | |
| 229 | 227 | .ref => try sema.zirRef(block, inst), |
| 230 | 228 | .shl => try sema.zirShl(block, inst), |
| 231 | 229 | .shr => try sema.zirShr(block, inst), |
| ... | ... | @@ -369,7 +367,6 @@ pub fn analyzeBody( |
| 369 | 367 | .compile_error => return sema.zirCompileError(block, inst), |
| 370 | 368 | .ret_coerce => return sema.zirRetTok(block, inst, true), |
| 371 | 369 | .ret_node => return sema.zirRetNode(block, inst), |
| 372 | .ret_tok => return sema.zirRetTok(block, inst, false), | |
| 373 | 370 | .@"unreachable" => return sema.zirUnreachable(block, inst), |
| 374 | 371 | .repeat => return sema.zirRepeat(block, inst), |
| 375 | 372 | .panic => return sema.zirPanic(block, inst), |
| ... | ... | @@ -2860,7 +2857,7 @@ fn analyzeAs( |
| 2860 | 2857 | return sema.coerce(block, dest_type, operand, src); |
| 2861 | 2858 | } |
| 2862 | 2859 | |
| 2863 | fn zirPtrtoint(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | |
| 2860 | fn zirPtrToInt(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | |
| 2864 | 2861 | const tracy = trace(@src()); |
| 2865 | 2862 | defer tracy.end(); |
| 2866 | 2863 | |
| ... | ... | @@ -2936,7 +2933,7 @@ fn zirFieldPtrNamed(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) Inne |
| 2936 | 2933 | return sema.namedFieldPtr(block, src, object_ptr, field_name, field_name_src); |
| 2937 | 2934 | } |
| 2938 | 2935 | |
| 2939 | fn zirIntcast(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | |
| 2936 | fn zirIntCast(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | |
| 2940 | 2937 | const tracy = trace(@src()); |
| 2941 | 2938 | defer tracy.end(); |
| 2942 | 2939 | |
| ... | ... | @@ -5161,12 +5158,6 @@ fn zirFrameAddress( |
| 5161 | 5158 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirFrameAddress", .{}); |
| 5162 | 5159 | } |
| 5163 | 5160 | |
| 5164 | fn zirPtrToInt(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | |
| 5165 | const inst_data = sema.code.instructions.items(.data)[inst].un_node; | |
| 5166 | const src = inst_data.src(); | |
| 5167 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirPtrToInt", .{}); | |
| 5168 | } | |
| 5169 | ||
| 5170 | 5161 | fn zirAlignOf(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { |
| 5171 | 5162 | const inst_data = sema.code.instructions.items(.data)[inst].un_node; |
| 5172 | 5163 | const src = inst_data.src(); |
| ... | ... | @@ -5245,12 +5236,6 @@ fn zirIntToPtr(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerErro |
| 5245 | 5236 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirIntToPtr", .{}); |
| 5246 | 5237 | } |
| 5247 | 5238 | |
| 5248 | fn zirIntCast(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | |
| 5249 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; | |
| 5250 | const src = inst_data.src(); | |
| 5251 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirIntCast", .{}); | |
| 5252 | } | |
| 5253 | ||
| 5254 | 5239 | fn zirErrSetCast(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { |
| 5255 | 5240 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; |
| 5256 | 5241 | const src = inst_data.src(); |
src/Zir.zig+4-17| ... | ... | @@ -384,11 +384,6 @@ pub const Inst = struct { |
| 384 | 384 | /// A float literal that fits in a f128. Uses the `pl_node` union value. |
| 385 | 385 | /// Payload is `Float128`. |
| 386 | 386 | float128, |
| 387 | /// Convert an integer value to another integer type, asserting that the destination type | |
| 388 | /// can hold the same mathematical value. | |
| 389 | /// Uses the `pl_node` field. AST is the `@intCast` syntax. | |
| 390 | /// Payload is `Bin` with lhs as the dest type, rhs the operand. | |
| 391 | intcast, | |
| 392 | 387 | /// Make an integer type out of signedness and bit count. |
| 393 | 388 | /// Payload is `int_type` |
| 394 | 389 | int_type, |
| ... | ... | @@ -445,9 +440,6 @@ pub const Inst = struct { |
| 445 | 440 | /// is not in a position where it must create an invalid type. |
| 446 | 441 | /// Uses the `param_type` union field. |
| 447 | 442 | param_type, |
| 448 | /// Convert a pointer to a `usize` integer. | |
| 449 | /// Uses the `un_node` field. The AST node is the builtin fn call node. | |
| 450 | ptrtoint, | |
| 451 | 443 | /// Turns an R-Value into a const L-Value. In other words, it takes a value, |
| 452 | 444 | /// stores it in a memory location, and returns a const pointer to it. If the value |
| 453 | 445 | /// is `comptime`, the memory location is global static constant data. Otherwise, |
| ... | ... | @@ -464,9 +456,7 @@ pub const Inst = struct { |
| 464 | 456 | /// Includes an operand as the return value. |
| 465 | 457 | /// Includes a token source location. |
| 466 | 458 | /// Uses the `un_tok` union field. |
| 467 | ret_tok, | |
| 468 | /// Same as `ret_tok` except the operand needs to get coerced to the function's | |
| 469 | /// return type. | |
| 459 | /// The operand needs to get coerced to the function's return type. | |
| 470 | 460 | ret_coerce, |
| 471 | 461 | /// Create a pointer type that does not have a sentinel, alignment, or bit range specified. |
| 472 | 462 | /// Uses the `ptr_type_simple` union field. |
| ... | ... | @@ -712,6 +702,7 @@ pub const Inst = struct { |
| 712 | 702 | shl_with_overflow, |
| 713 | 703 | |
| 714 | 704 | /// Implement builtin `@ptrToInt`. Uses `un_node`. |
| 705 | /// Convert a pointer to a `usize` integer. | |
| 715 | 706 | ptr_to_int, |
| 716 | 707 | /// Implement builtin `@errToInt`. Uses `un_node`. |
| 717 | 708 | error_to_int, |
| ... | ... | @@ -801,6 +792,8 @@ pub const Inst = struct { |
| 801 | 792 | float_cast, |
| 802 | 793 | /// Implements the `@intCast` builtin. |
| 803 | 794 | /// Uses `pl_node` with payload `Bin`. `lhs` is dest type, `rhs` is operand. |
| 795 | /// Convert an integer value to another integer type, asserting that the destination type | |
| 796 | /// can hold the same mathematical value. | |
| 804 | 797 | int_cast, |
| 805 | 798 | /// Implements the `@errSetCast` builtin. |
| 806 | 799 | /// Uses `pl_node` with payload `Bin`. `lhs` is dest type, `rhs` is operand. |
| ... | ... | @@ -1030,7 +1023,6 @@ pub const Inst = struct { |
| 1030 | 1023 | .int_big, |
| 1031 | 1024 | .float, |
| 1032 | 1025 | .float128, |
| 1033 | .intcast, | |
| 1034 | 1026 | .int_type, |
| 1035 | 1027 | .is_non_null, |
| 1036 | 1028 | .is_null, |
| ... | ... | @@ -1042,7 +1034,6 @@ pub const Inst = struct { |
| 1042 | 1034 | .mul, |
| 1043 | 1035 | .mulwrap, |
| 1044 | 1036 | .param_type, |
| 1045 | .ptrtoint, | |
| 1046 | 1037 | .ref, |
| 1047 | 1038 | .shl, |
| 1048 | 1039 | .shr, |
| ... | ... | @@ -1202,7 +1193,6 @@ pub const Inst = struct { |
| 1202 | 1193 | .condbr_inline, |
| 1203 | 1194 | .compile_error, |
| 1204 | 1195 | .ret_node, |
| 1205 | .ret_tok, | |
| 1206 | 1196 | .ret_coerce, |
| 1207 | 1197 | .@"unreachable", |
| 1208 | 1198 | .repeat, |
| ... | ... | @@ -2341,7 +2331,6 @@ const Writer = struct { |
| 2341 | 2331 | .coerce_result_ptr, |
| 2342 | 2332 | .elem_ptr, |
| 2343 | 2333 | .elem_val, |
| 2344 | .intcast, | |
| 2345 | 2334 | .store, |
| 2346 | 2335 | .store_to_block_ptr, |
| 2347 | 2336 | .store_to_inferred_ptr, |
| ... | ... | @@ -2362,7 +2351,6 @@ const Writer = struct { |
| 2362 | 2351 | .load, |
| 2363 | 2352 | .ensure_result_used, |
| 2364 | 2353 | .ensure_result_non_error, |
| 2365 | .ptrtoint, | |
| 2366 | 2354 | .ret_node, |
| 2367 | 2355 | .resolve_inferred_alloc, |
| 2368 | 2356 | .optional_type, |
| ... | ... | @@ -2432,7 +2420,6 @@ const Writer = struct { |
| 2432 | 2420 | => try self.writeUnNode(stream, inst), |
| 2433 | 2421 | |
| 2434 | 2422 | .ref, |
| 2435 | .ret_tok, | |
| 2436 | 2423 | .ret_coerce, |
| 2437 | 2424 | .ensure_err_payload_void, |
| 2438 | 2425 | => try self.writeUnTok(stream, inst), |