mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 03:29:34 +01:00
* clean usercode_entry flag from outer block when copying a subroutine node tree for inlining, enables sometimes better inlining
git-svn-id: trunk@29627 -
This commit is contained in:
parent
e7dd48cba3
commit
d6bfb29313
@ -4194,6 +4194,18 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
{ this procedure removes the user code flag because it prevents optimizations }
|
||||
function removeusercodeflag(var n : tnode; arg : pointer) : foreachnoderesult;
|
||||
begin
|
||||
result:=fen_false;
|
||||
if nf_usercode_entry in n.flags then
|
||||
begin
|
||||
exclude(n.flags,nf_usercode_entry);
|
||||
result:=fen_norecurse_true;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function tcallnode.pass1_inline:tnode;
|
||||
var
|
||||
n,
|
||||
@ -4230,6 +4242,7 @@ implementation
|
||||
|
||||
{ create a copy of the body and replace parameter loads with the parameter values }
|
||||
body:=tprocdef(procdefinition).inlininginfo^.code.getcopy;
|
||||
foreachnodestatic(pm_postprocess,body,@removeusercodeflag,nil);
|
||||
foreachnode(pm_preprocess,body,@replaceparaload,@fileinfo);
|
||||
|
||||
{ Concat the body and finalization parts }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user