mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 04:19:07 +02:00
* optimize CheckAndWarn
git-svn-id: trunk@26164 -
This commit is contained in:
parent
35206c3d93
commit
6924cc0458
@ -812,10 +812,9 @@ unit optdfa;
|
|||||||
i : longint;
|
i : longint;
|
||||||
touchesnode : Boolean;
|
touchesnode : Boolean;
|
||||||
|
|
||||||
procedure MaybeDoCheck(n : tnode);
|
procedure MaybeDoCheck(n : tnode);inline;
|
||||||
begin
|
begin
|
||||||
if not(Result) then
|
Result:=Result or DoCheck(n);
|
||||||
Result:=Result or DoCheck(n);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure MaybeSearchIn(n : tnode);
|
procedure MaybeSearchIn(n : tnode);
|
||||||
@ -834,12 +833,17 @@ unit optdfa;
|
|||||||
exit;
|
exit;
|
||||||
include(node.flags,nf_processing);
|
include(node.flags,nf_processing);
|
||||||
|
|
||||||
touchesnode:=DFASetIn(node.optinfo^.use,nodetosearch.optinfo^.index) or
|
|
||||||
DFASetIn(node.optinfo^.def,nodetosearch.optinfo^.index);
|
|
||||||
|
|
||||||
if not(DFASetIn(node.optinfo^.life,nodetosearch.optinfo^.index)) then
|
if not(DFASetIn(node.optinfo^.life,nodetosearch.optinfo^.index)) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
{ we do not need this info always, so try to safe some time here, CheckAndWarn
|
||||||
|
takes a lot of time anyways }
|
||||||
|
if not(node.nodetype in [statementn,blockn]) then
|
||||||
|
touchesnode:=DFASetIn(node.optinfo^.use,nodetosearch.optinfo^.index) or
|
||||||
|
DFASetIn(node.optinfo^.def,nodetosearch.optinfo^.index)
|
||||||
|
else
|
||||||
|
touchesnode:=false;
|
||||||
|
|
||||||
case node.nodetype of
|
case node.nodetype of
|
||||||
whilerepeatn:
|
whilerepeatn:
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user