mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 11:38:19 +02:00
* New blocknode optimisation that removes goto nodes that come right before the label they jump to
This commit is contained in:
parent
f817167760
commit
2734225935
@ -371,7 +371,7 @@ implementation
|
||||
ppu,
|
||||
symsym,symconst,symdef,defutil,defcmp,
|
||||
pass_1,
|
||||
nutils,nld,ncnv,
|
||||
nutils,nld,ncnv,nflw,
|
||||
procinfo
|
||||
{$ifdef DEBUG_NODE_XML}
|
||||
{$ifndef jvm}
|
||||
@ -872,6 +872,19 @@ implementation
|
||||
n.right := MergeNestedBlock(p);
|
||||
Continue;
|
||||
end;
|
||||
goton:
|
||||
begin
|
||||
last := TStatementNode(p.Next);
|
||||
if Assigned(last) and
|
||||
Assigned(last.statement) and
|
||||
(TGotoNode(p.statement).labelnode = last.statement) then
|
||||
begin
|
||||
{ Goto jumps to a label that immediately follows it }
|
||||
n.right := p.PruneKeepRight();
|
||||
p.Free;
|
||||
Continue;
|
||||
end;
|
||||
end;
|
||||
else
|
||||
;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user