mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 22:49:23 +02:00
* 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:
parent
042ad497d3
commit
254d0c0e2c
@ -2383,11 +2383,17 @@ implementation
|
|||||||
{ parse the code ... }
|
{ parse the code ... }
|
||||||
code:=block(current_module.islibrary);
|
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
|
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);
|
exclude(procdef.procoptions, po_delphi_nested_cc);
|
||||||
parentfp_sym:=procdef.parast.Find('parentfp');
|
parentfp_sym:=procdef.parast.Find('parentfp');
|
||||||
if parentfp_sym = nil then
|
if parentfp_sym = nil then
|
||||||
|
Loading…
Reference in New Issue
Block a user