diff options
| author | Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com> | 2023-11-25 20:29:07 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-25 17:29:07 +0000 |
| commit | 2252dcc508c53dc302ec1f919c4792a7f00ce125 (patch) | |
| tree | 5b4fb9d2ded6453efa46012d98e6503904c3aee4 /src/Sema.zig | |
| parent | bece97ef248ad36d31a48fb761b4a41324c9c5d5 (diff) | |
| download | zig-2252dcc508c53dc302ec1f919c4792a7f00ce125.tar.gz zig-2252dcc508c53dc302ec1f919c4792a7f00ce125.zip | |
Compiler: move checking function-scope-only builtins to AstGen
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 87790dbdb1..4a30c6d695 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -6151,9 +6151,6 @@ fn zirSetAlignStack(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.Inst alignment.toByteUnitsOptional().?, }); } - if (sema.func_index == .none) { - return sema.fail(block, src, "@setAlignStack outside function body", .{}); - } const fn_owner_decl = mod.funcOwnerDeclPtr(sema.func_index); switch (fn_owner_decl.ty.fnCallingConvention(mod)) { @@ -16780,13 +16777,12 @@ fn zirBuiltinSrc( block: *Block, extended: Zir.Inst.Extended.InstData, ) CompileError!Air.Inst.Ref { + _ = block; const tracy = trace(@src()); defer tracy.end(); const mod = sema.mod; const extra = sema.code.extraData(Zir.Inst.Src, extended.operand).data; - const src = LazySrcLoc.nodeOffset(extra.node); - if (sema.func_index == .none) return sema.fail(block, src, "@src outside function", .{}); const fn_owner_decl = mod.funcOwnerDeclPtr(sema.func_index); const ip = &mod.intern_pool; const gpa = sema.gpa; |
