|
@@ -93,7 +93,7 @@ unit optconstprop;
|
|
iterate manually here so we have full controll how all nodes are processed }
|
|
iterate manually here so we have full controll how all nodes are processed }
|
|
|
|
|
|
{ We cannot analyze beyond those nodes, so we terminate to be on the safe side }
|
|
{ We cannot analyze beyond those nodes, so we terminate to be on the safe side }
|
|
- if (n.nodetype in [addrn,derefn,dataconstn,asmn,withn,casen,whilerepeatn,forn,labeln,continuen,breakn,
|
|
|
|
|
|
+ if (n.nodetype in [addrn,derefn,dataconstn,asmn,withn,casen,whilerepeatn,labeln,continuen,breakn,
|
|
tryexceptn,raisen,tryfinallyn,onn,loadparentfpn,loadvmtaddrn,guidconstn,rttin,addoptn,asn,goton,
|
|
tryexceptn,raisen,tryfinallyn,onn,loadparentfpn,loadvmtaddrn,guidconstn,rttin,addoptn,asn,goton,
|
|
objcselectorn,objcprotocoln]) then
|
|
objcselectorn,objcprotocoln]) then
|
|
exit(false)
|
|
exit(false)
|
|
@@ -123,6 +123,15 @@ unit optconstprop;
|
|
end
|
|
end
|
|
else if n.nodetype=statementn then
|
|
else if n.nodetype=statementn then
|
|
result:=replaceBasicAssign(tstatementnode(n).left, arg, tree_modified)
|
|
result:=replaceBasicAssign(tstatementnode(n).left, arg, tree_modified)
|
|
|
|
+ else if n.nodetype=forn then
|
|
|
|
+ begin
|
|
|
|
+ result:=replaceBasicAssign(tfornode(n).right, arg, tree_modified);
|
|
|
|
+ if result then
|
|
|
|
+ replaceBasicAssign(tfornode(n).t1, arg, tree_modified2);
|
|
|
|
+ tree_modified:=tree_modified or tree_modified2;
|
|
|
|
+ { after a for node we cannot continue with our simple approach }
|
|
|
|
+ result:=false;
|
|
|
|
+ end
|
|
else if n.nodetype=blockn then
|
|
else if n.nodetype=blockn then
|
|
begin
|
|
begin
|
|
changed:=false;
|
|
changed:=false;
|