* Do not perform optimization of nested procedures for:

- targets which use a special struct to access parent's variables;
  - pure assembler procedures (for compatibility with old code).

git-svn-id: trunk@45322 -
This commit is contained in:
yury 2020-05-09 20:45:00 +00:00
parent 042ad497d3
commit 254d0c0e2c

View File

@ -2383,11 +2383,17 @@ implementation
{ parse the code ... }
code:=block(current_module.islibrary);
if is_nested_pd(procdef) and not (pio_needs_parentfp in procdef.implprocoptions) then
{ If this is a nested procedure which does not access its parent's frame
pointer, we can optimize it by removing the hidden $parentfp parameter.
Do not perform this for:
- targets which use a special struct to access parent's variables;
- pure assembler procedures (for compatibility with old code).
}
if not (target_info.system in systems_fpnestedstruct) and
is_nested_pd(procdef) and
not (pio_needs_parentfp in procdef.implprocoptions) and
not (po_assembler in procdef.procoptions) then
begin
{ If this nested procedure does not access its parent's frame pointer,
we can optimize it by removing the hidden $parentfp parameter.
}
exclude(procdef.procoptions, po_delphi_nested_cc);
parentfp_sym:=procdef.parast.Find('parentfp');
if parentfp_sym = nil then