| author | |
| committer | |
| log | a2c47d2b0b0475b15a81067bf5d764ce6ae609b3 |
| tree | 3e7b786b084b86dfebafb69b20a8beb89856ada6 |
| parent | 1bb30c5e228f4a5ebc42cc23e593ebad3bd6dbbe |
| signature | Commit is signed but in an unrecognized format. |
6 files changed, 1 insertions(+), 47 deletions(-)
src/all_types.hpp-6| ... | ... | @@ -1809,7 +1809,6 @@ enum BuiltinFnId { |
| 1809 | 1809 | BuiltinFnIdShrExact, |
| 1810 | 1810 | BuiltinFnIdSetEvalBranchQuota, |
| 1811 | 1811 | BuiltinFnIdAlignCast, |
| 1812 | BuiltinFnIdOpaqueType, | |
| 1813 | 1812 | BuiltinFnIdThis, |
| 1814 | 1813 | BuiltinFnIdSetAlignStack, |
| 1815 | 1814 | BuiltinFnIdExport, |
| ... | ... | @@ -2734,7 +2733,6 @@ enum IrInstSrcId { |
| 2734 | 2733 | IrInstSrcIdImplicitCast, |
| 2735 | 2734 | IrInstSrcIdResolveResult, |
| 2736 | 2735 | IrInstSrcIdResetResult, |
| 2737 | IrInstSrcIdOpaqueType, | |
| 2738 | 2736 | IrInstSrcIdSetAlignStack, |
| 2739 | 2737 | IrInstSrcIdArgType, |
| 2740 | 2738 | IrInstSrcIdExport, |
| ... | ... | @@ -4234,10 +4232,6 @@ struct IrInstGenAlignCast { |
| 4234 | 4232 | IrInstGen *target; |
| 4235 | 4233 | }; |
| 4236 | 4234 | |
| 4237 | struct IrInstSrcOpaqueType { | |
| 4238 | IrInstSrc base; | |
| 4239 | }; | |
| 4240 | ||
| 4241 | 4235 | struct IrInstSrcSetAlignStack { |
| 4242 | 4236 | IrInstSrc base; |
| 4243 | 4237 |
src/codegen.cpp-1| ... | ... | @@ -8699,7 +8699,6 @@ static void define_builtin_fns(CodeGen *g) { |
| 8699 | 8699 | create_builtin_fn(g, BuiltinFnIdShrExact, "shrExact", 2); |
| 8700 | 8700 | create_builtin_fn(g, BuiltinFnIdSetEvalBranchQuota, "setEvalBranchQuota", 1); |
| 8701 | 8701 | create_builtin_fn(g, BuiltinFnIdAlignCast, "alignCast", 2); |
| 8702 | create_builtin_fn(g, BuiltinFnIdOpaqueType, "OpaqueType", 0); | |
| 8703 | 8702 | create_builtin_fn(g, BuiltinFnIdSetAlignStack, "setAlignStack", 1); |
| 8704 | 8703 | create_builtin_fn(g, BuiltinFnIdExport, "export", 2); |
| 8705 | 8704 | create_builtin_fn(g, BuiltinFnIdErrorReturnTrace, "errorReturnTrace", 0); |
src/ir.cpp-29| ... | ... | @@ -505,8 +505,6 @@ static void destroy_instruction_src(IrInstSrc *inst) { |
| 505 | 505 | return heap::c_allocator.destroy(reinterpret_cast<IrInstSrcResolveResult *>(inst)); |
| 506 | 506 | case IrInstSrcIdResetResult: |
| 507 | 507 | return heap::c_allocator.destroy(reinterpret_cast<IrInstSrcResetResult *>(inst)); |
| 508 | case IrInstSrcIdOpaqueType: | |
| 509 | return heap::c_allocator.destroy(reinterpret_cast<IrInstSrcOpaqueType *>(inst)); | |
| 510 | 508 | case IrInstSrcIdSetAlignStack: |
| 511 | 509 | return heap::c_allocator.destroy(reinterpret_cast<IrInstSrcSetAlignStack *>(inst)); |
| 512 | 510 | case IrInstSrcIdArgType: |
| ... | ... | @@ -1532,10 +1530,6 @@ static constexpr IrInstSrcId ir_inst_id(IrInstSrcResetResult *) { |
| 1532 | 1530 | return IrInstSrcIdResetResult; |
| 1533 | 1531 | } |
| 1534 | 1532 | |
| 1535 | static constexpr IrInstSrcId ir_inst_id(IrInstSrcOpaqueType *) { | |
| 1536 | return IrInstSrcIdOpaqueType; | |
| 1537 | } | |
| 1538 | ||
| 1539 | 1533 | static constexpr IrInstSrcId ir_inst_id(IrInstSrcSetAlignStack *) { |
| 1540 | 1534 | return IrInstSrcIdSetAlignStack; |
| 1541 | 1535 | } |
| ... | ... | @@ -4535,12 +4529,6 @@ static IrInstSrc *ir_build_reset_result(IrBuilderSrc *irb, Scope *scope, AstNode |
| 4535 | 4529 | return &instruction->base; |
| 4536 | 4530 | } |
| 4537 | 4531 | |
| 4538 | static IrInstSrc *ir_build_opaque_type(IrBuilderSrc *irb, Scope *scope, AstNode *source_node) { | |
| 4539 | IrInstSrcOpaqueType *instruction = ir_build_instruction<IrInstSrcOpaqueType>(irb, scope, source_node); | |
| 4540 | ||
| 4541 | return &instruction->base; | |
| 4542 | } | |
| 4543 | ||
| 4544 | 4532 | static IrInstSrc *ir_build_set_align_stack(IrBuilderSrc *irb, Scope *scope, AstNode *source_node, |
| 4545 | 4533 | IrInstSrc *align_bytes) |
| 4546 | 4534 | { |
| ... | ... | @@ -7310,11 +7298,6 @@ static IrInstSrc *ir_gen_builtin_fn_call(IrBuilderSrc *irb, Scope *scope, AstNod |
| 7310 | 7298 | IrInstSrc *align_cast = ir_build_align_cast_src(irb, scope, node, arg0_value, arg1_value); |
| 7311 | 7299 | return ir_lval_wrap(irb, scope, align_cast, lval, result_loc); |
| 7312 | 7300 | } |
| 7313 | case BuiltinFnIdOpaqueType: | |
| 7314 | { | |
| 7315 | IrInstSrc *opaque_type = ir_build_opaque_type(irb, scope, node); | |
| 7316 | return ir_lval_wrap(irb, scope, opaque_type, lval, result_loc); | |
| 7317 | } | |
| 7318 | 7301 | case BuiltinFnIdThis: |
| 7319 | 7302 | { |
| 7320 | 7303 | IrInstSrc *this_inst = ir_gen_this(irb, scope, node); |
| ... | ... | @@ -30263,15 +30246,6 @@ static IrInstGen *ir_analyze_instruction_align_cast(IrAnalyze *ira, IrInstSrcAli |
| 30263 | 30246 | return result; |
| 30264 | 30247 | } |
| 30265 | 30248 | |
| 30266 | static IrInstGen *ir_analyze_instruction_opaque_type(IrAnalyze *ira, IrInstSrcOpaqueType *instruction) { | |
| 30267 | Buf *bare_name = buf_alloc(); | |
| 30268 | Buf *full_name = get_anon_type_name(ira->codegen, ira->old_irb.exec, "opaque", | |
| 30269 | instruction->base.base.scope, instruction->base.base.source_node, bare_name); | |
| 30270 | ZigType *result_type = get_opaque_type(ira->codegen, instruction->base.base.scope, | |
| 30271 | instruction->base.base.source_node, buf_ptr(full_name), bare_name); | |
| 30272 | return ir_const_type(ira, &instruction->base.base, result_type); | |
| 30273 | } | |
| 30274 | ||
| 30275 | 30249 | static IrInstGen *ir_analyze_instruction_set_align_stack(IrAnalyze *ira, IrInstSrcSetAlignStack *instruction) { |
| 30276 | 30250 | uint32_t align_bytes; |
| 30277 | 30251 | IrInstGen *align_bytes_inst = instruction->align_bytes->child; |
| ... | ... | @@ -31736,8 +31710,6 @@ static IrInstGen *ir_analyze_instruction_base(IrAnalyze *ira, IrInstSrc *instruc |
| 31736 | 31710 | return ir_analyze_instruction_resolve_result(ira, (IrInstSrcResolveResult *)instruction); |
| 31737 | 31711 | case IrInstSrcIdResetResult: |
| 31738 | 31712 | return ir_analyze_instruction_reset_result(ira, (IrInstSrcResetResult *)instruction); |
| 31739 | case IrInstSrcIdOpaqueType: | |
| 31740 | return ir_analyze_instruction_opaque_type(ira, (IrInstSrcOpaqueType *)instruction); | |
| 31741 | 31713 | case IrInstSrcIdSetAlignStack: |
| 31742 | 31714 | return ir_analyze_instruction_set_align_stack(ira, (IrInstSrcSetAlignStack *)instruction); |
| 31743 | 31715 | case IrInstSrcIdArgType: |
| ... | ... | @@ -32181,7 +32153,6 @@ bool ir_inst_src_has_side_effects(IrInstSrc *instruction) { |
| 32181 | 32153 | case IrInstSrcIdAlignCast: |
| 32182 | 32154 | case IrInstSrcIdImplicitCast: |
| 32183 | 32155 | case IrInstSrcIdResolveResult: |
| 32184 | case IrInstSrcIdOpaqueType: | |
| 32185 | 32156 | case IrInstSrcIdArgType: |
| 32186 | 32157 | case IrInstSrcIdTagType: |
| 32187 | 32158 | case IrInstSrcIdErrorReturnTrace: |
src/ir_print.cpp-9| ... | ... | @@ -306,8 +306,6 @@ const char* ir_inst_src_type_str(IrInstSrcId id) { |
| 306 | 306 | return "SrcResolveResult"; |
| 307 | 307 | case IrInstSrcIdResetResult: |
| 308 | 308 | return "SrcResetResult"; |
| 309 | case IrInstSrcIdOpaqueType: | |
| 310 | return "SrcOpaqueType"; | |
| 311 | 309 | case IrInstSrcIdSetAlignStack: |
| 312 | 310 | return "SrcSetAlignStack"; |
| 313 | 311 | case IrInstSrcIdArgType: |
| ... | ... | @@ -2315,10 +2313,6 @@ static void ir_print_reset_result(IrPrintSrc *irp, IrInstSrcResetResult *instruc |
| 2315 | 2313 | fprintf(irp->f, ")"); |
| 2316 | 2314 | } |
| 2317 | 2315 | |
| 2318 | static void ir_print_opaque_type(IrPrintSrc *irp, IrInstSrcOpaqueType *instruction) { | |
| 2319 | fprintf(irp->f, "@OpaqueType()"); | |
| 2320 | } | |
| 2321 | ||
| 2322 | 2316 | static void ir_print_set_align_stack(IrPrintSrc *irp, IrInstSrcSetAlignStack *instruction) { |
| 2323 | 2317 | fprintf(irp->f, "@setAlignStack("); |
| 2324 | 2318 | ir_print_other_inst_src(irp, instruction->align_bytes); |
| ... | ... | @@ -2911,9 +2905,6 @@ static void ir_print_inst_src(IrPrintSrc *irp, IrInstSrc *instruction, bool trai |
| 2911 | 2905 | case IrInstSrcIdResetResult: |
| 2912 | 2906 | ir_print_reset_result(irp, (IrInstSrcResetResult *)instruction); |
| 2913 | 2907 | break; |
| 2914 | case IrInstSrcIdOpaqueType: | |
| 2915 | ir_print_opaque_type(irp, (IrInstSrcOpaqueType *)instruction); | |
| 2916 | break; | |
| 2917 | 2908 | case IrInstSrcIdSetAlignStack: |
| 2918 | 2909 | ir_print_set_align_stack(irp, (IrInstSrcSetAlignStack *)instruction); |
| 2919 | 2910 | break; |
test/compile_errors.zig+1-1| ... | ... | @@ -7394,7 +7394,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 7394 | 7394 | }); |
| 7395 | 7395 | |
| 7396 | 7396 | cases.add("function parameter is opaque", |
| 7397 | \\const FooType = @OpaqueType(); | |
| 7397 | \\const FooType = @Type(.Opaque); | |
| 7398 | 7398 | \\export fn entry1() void { |
| 7399 | 7399 | \\ const someFuncPtr: fn (FooType) void = undefined; |
| 7400 | 7400 | \\} |
test/stage1/behavior/type.zig-1| ... | ... | @@ -190,7 +190,6 @@ test "Type.ErrorUnion" { |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | test "Type.Opaque" { |
| 193 | testing.expect(@OpaqueType() != @Type(.Opaque)); | |
| 194 | 193 | testing.expect(@Type(.Opaque) != @Type(.Opaque)); |
| 195 | 194 | testing.expect(@typeInfo(@Type(.Opaque)) == .Opaque); |
| 196 | 195 | } |