* let inline parameter temps inherit the "const" property of const

parameters, so we don't apply reference counting to them (mantis #30323)

git-svn-id: trunk@34288 -
This commit is contained in:
Jonas Maebe 2016-08-12 13:35:53 +00:00
parent 18580d3069
commit 70b1b32722

View File

@ -4686,12 +4686,26 @@ implementation
addstatement(inlinecleanupstatement,ctempdeletenode.create(tempnode));
addstatement(inlineinitstatement,cassignmentnode.create(ctemprefnode.create(tempnode),
para.left));
para.left));
para.left := ctemprefnode.create(tempnode);
{ inherit addr_taken flag }
if (tabstractvarsym(para.parasym).addr_taken) then
include(tempnode.tempinfo^.flags,ti_addr_taken);
{ inherit const }
if tabstractvarsym(para.parasym).varspez=vs_const then
begin
include(tempnode.tempinfo^.flags,ti_const);
{ apply less strict rules for the temp. to be a register than
ttempcreatenode does
this way, dyn. array, ansistrings etc. can be put into registers as well }
if tparavarsym(para.parasym).is_regvar(false) then
include(tempnode.tempinfo^.flags,ti_may_be_in_reg);
end;
result:=true;
end
end;