| ... | @@ -5031,6 +5031,7 @@ fn zirBlock(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileErro | ... | @@ -5031,6 +5031,7 @@ fn zirBlock(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileErro |
| 5031 | .label = &label, | 5031 | .label = &label, |
| 5032 | .inlining = parent_block.inlining, | 5032 | .inlining = parent_block.inlining, |
| 5033 | .is_comptime = parent_block.is_comptime, | 5033 | .is_comptime = parent_block.is_comptime, |
| | 5034 | .is_typeof = parent_block.is_typeof, |
| 5034 | .want_safety = parent_block.want_safety, | 5035 | .want_safety = parent_block.want_safety, |
| 5035 | .float_mode = parent_block.float_mode, | 5036 | .float_mode = parent_block.float_mode, |
| 5036 | .runtime_cond = parent_block.runtime_cond, | 5037 | .runtime_cond = parent_block.runtime_cond, |
| ... | @@ -5923,7 +5924,7 @@ fn zirCall( | ... | @@ -5923,7 +5924,7 @@ fn zirCall( |
| 5923 | | 5924 | |
| 5924 | const backend_supports_error_return_tracing = sema.mod.comp.bin_file.options.use_llvm; | 5925 | const backend_supports_error_return_tracing = sema.mod.comp.bin_file.options.use_llvm; |
| 5925 | if (backend_supports_error_return_tracing and sema.mod.comp.bin_file.options.error_return_tracing and | 5926 | if (backend_supports_error_return_tracing and sema.mod.comp.bin_file.options.error_return_tracing and |
| 5926 | !block.is_comptime and (input_is_error or pop_error_return_trace)) | 5927 | !block.is_comptime and !block.is_typeof and (input_is_error or pop_error_return_trace)) |
| 5927 | { | 5928 | { |
| 5928 | const call_inst: Air.Inst.Ref = if (modifier == .always_tail) undefined else b: { | 5929 | const call_inst: Air.Inst.Ref = if (modifier == .always_tail) undefined else b: { |
| 5929 | break :b try sema.analyzeCall(block, func, func_src, call_src, modifier, ensure_result_used, resolved_args, bound_arg_src); | 5930 | break :b try sema.analyzeCall(block, func, func_src, call_src, modifier, ensure_result_used, resolved_args, bound_arg_src); |
| ... | @@ -6403,7 +6404,7 @@ fn analyzeCall( | ... | @@ -6403,7 +6404,7 @@ fn analyzeCall( |
| 6403 | } | 6404 | } |
| 6404 | | 6405 | |
| 6405 | const new_func_resolved_ty = try Type.Tag.function.create(sema.arena, new_fn_info); | 6406 | const new_func_resolved_ty = try Type.Tag.function.create(sema.arena, new_fn_info); |
| 6406 | if (!is_comptime_call) { | 6407 | if (!is_comptime_call and !block.is_typeof) { |
| 6407 | try sema.emitDbgInline(block, parent_func.?, module_fn, new_func_resolved_ty, .dbg_inline_begin); | 6408 | try sema.emitDbgInline(block, parent_func.?, module_fn, new_func_resolved_ty, .dbg_inline_begin); |
| 6408 | | 6409 | |
| 6409 | const zir_tags = sema.code.instructions.items(.tag); | 6410 | const zir_tags = sema.code.instructions.items(.tag); |
| ... | @@ -6441,7 +6442,7 @@ fn analyzeCall( | ... | @@ -6441,7 +6442,7 @@ fn analyzeCall( |
| 6441 | break :result try sema.analyzeBlockBody(block, call_src, &child_block, merges); | 6442 | break :result try sema.analyzeBlockBody(block, call_src, &child_block, merges); |
| 6442 | }; | 6443 | }; |
| 6443 | | 6444 | |
| 6444 | if (!is_comptime_call and sema.typeOf(result).zigTypeTag() != .NoReturn) { | 6445 | if (!is_comptime_call and !block.is_typeof and sema.typeOf(result).zigTypeTag() != .NoReturn) { |
| 6445 | try sema.emitDbgInline( | 6446 | try sema.emitDbgInline( |
| 6446 | block, | 6447 | block, |
| 6447 | module_fn, | 6448 | module_fn, |
| ... | @@ -10210,6 +10211,7 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError | ... | @@ -10210,6 +10211,7 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError |
| 10210 | .label = &label, | 10211 | .label = &label, |
| 10211 | .inlining = block.inlining, | 10212 | .inlining = block.inlining, |
| 10212 | .is_comptime = block.is_comptime, | 10213 | .is_comptime = block.is_comptime, |
| | 10214 | .is_typeof = block.is_typeof, |
| 10213 | .switch_else_err_ty = else_error_ty, | 10215 | .switch_else_err_ty = else_error_ty, |
| 10214 | .runtime_cond = block.runtime_cond, | 10216 | .runtime_cond = block.runtime_cond, |
| 10215 | .runtime_loop = block.runtime_loop, | 10217 | .runtime_loop = block.runtime_loop, |
| ... | @@ -16401,7 +16403,7 @@ fn zirSaveErrRetIndex(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileE | ... | @@ -16401,7 +16403,7 @@ fn zirSaveErrRetIndex(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileE |
| 16401 | if (!ok) return; | 16403 | if (!ok) return; |
| 16402 | | 16404 | |
| 16403 | // This is only relevant at runtime. | 16405 | // This is only relevant at runtime. |
| 16404 | if (block.is_comptime) return; | 16406 | if (block.is_comptime or block.is_typeof) return; |
| 16405 | | 16407 | |
| 16406 | // This is only relevant within functions. | 16408 | // This is only relevant within functions. |
| 16407 | if (sema.func == null) return; | 16409 | if (sema.func == null) return; |
| ... | @@ -16421,7 +16423,7 @@ fn zirRestoreErrRetIndex(sema: *Sema, start_block: *Block, inst: Zir.Inst.Index) | ... | @@ -16421,7 +16423,7 @@ fn zirRestoreErrRetIndex(sema: *Sema, start_block: *Block, inst: Zir.Inst.Index) |
| 16421 | const src = sema.src; // TODO | 16423 | const src = sema.src; // TODO |
| 16422 | | 16424 | |
| 16423 | // This is only relevant at runtime. | 16425 | // This is only relevant at runtime. |
| 16424 | if (start_block.is_comptime) return; | 16426 | if (start_block.is_comptime or start_block.is_typeof) return; |
| 16425 | | 16427 | |
| 16426 | const backend_supports_error_return_tracing = sema.mod.comp.bin_file.options.use_llvm; | 16428 | const backend_supports_error_return_tracing = sema.mod.comp.bin_file.options.use_llvm; |
| 16427 | const ok = sema.owner_func.?.calls_or_awaits_errorable_fn and | 16429 | const ok = sema.owner_func.?.calls_or_awaits_errorable_fn and |