* 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:
florian 2015-02-04 21:18:04 +00:00
parent e7dd48cba3
commit d6bfb29313

View File

@ -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 }