omit prefix data for async functions sometimes

When `@frameSize` is never called, and `@asyncCall` on a runtime-known
pointer is never used, no prefix data for async functions is needed.

Related: #3160
This commit is contained in:
Andrew Kelley
2019-09-02 21:22:35 -04:00
parent 00d82e34df
commit d74b8567cf
3 changed files with 8 additions and 1 deletions

View File

@@ -15671,6 +15671,7 @@ static IrInstruction *analyze_casted_new_stack(IrAnalyze *ira, IrInstructionCall
ZigType *u8_ptr = get_pointer_to_type_extra(ira->codegen, ira->codegen->builtin_types.entry_u8,
false, false, PtrLenUnknown, target_fn_align(ira->codegen->zig_target), 0, 0, false);
ZigType *u8_slice = get_slice_type(ira->codegen, u8_ptr);
ira->codegen->need_frame_size_prefix_data = true;
return ir_implicit_cast(ira, new_stack, u8_slice);
}
}
@@ -22533,6 +22534,8 @@ static IrInstruction *ir_analyze_instruction_frame_size(IrAnalyze *ira, IrInstru
return ira->codegen->invalid_instruction;
}
ira->codegen->need_frame_size_prefix_data = true;
IrInstruction *result = ir_build_frame_size_gen(&ira->new_irb, instruction->base.scope,
instruction->base.source_node, fn);
result->value.type = ira->codegen->builtin_types.entry_usize;