mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 20:28:49 +02:00
* use labelCanBeSkipped as used by i386 in generic optimizer code too
git-svn-id: trunk@12807 -
This commit is contained in:
parent
91dcb722a2
commit
f97730f73f
@ -141,6 +141,11 @@ unit aoptbase;
|
||||
{$endif RefsHaveIndexReg}
|
||||
End;
|
||||
|
||||
function labelCanBeSkipped(p: tai_label): boolean;
|
||||
begin
|
||||
labelCanBeSkipped := not(p.labsym.is_used) or (p.labsym.labeltype<>alt_jump);
|
||||
end;
|
||||
|
||||
Function TAOptBase.GetNextInstruction(Current: tai; Var Next: tai): Boolean;
|
||||
Begin
|
||||
Repeat
|
||||
@ -153,7 +158,7 @@ unit aoptbase;
|
||||
) or
|
||||
{$endif SPARC}
|
||||
((Current.typ = ait_label) And
|
||||
Not(Tai_Label(Current).labsym.is_used))) Do
|
||||
labelCanBeSkipped(Tai_Label(Current)))) Do
|
||||
Current := tai(Current.Next);
|
||||
If Assigned(Current) And
|
||||
(Current.typ = ait_Marker) And
|
||||
@ -171,7 +176,7 @@ unit aoptbase;
|
||||
If Assigned(Current) And
|
||||
Not((Current.typ In SkipInstr) or
|
||||
((Current.typ = ait_label) And
|
||||
Not(Tai_Label(Current).labsym.is_used)))
|
||||
labelCanBeSkipped(Tai_Label(Current))))
|
||||
Then GetNextInstruction := True
|
||||
Else
|
||||
Begin
|
||||
@ -189,7 +194,7 @@ unit aoptbase;
|
||||
Not(Tai_Marker(Current).Kind in [mark_AsmBlockEnd,mark_NoPropInfoEnd])) or
|
||||
(Current.typ In SkipInstr) or
|
||||
((Current.typ = ait_label) And
|
||||
Not(Tai_Label(Current).labsym.is_used))) Do
|
||||
labelCanBeSkipped(Tai_Label(Current)))) Do
|
||||
Current := Tai(Current.previous);
|
||||
If Assigned(Current) And
|
||||
(Current.typ = ait_Marker) And
|
||||
@ -206,7 +211,7 @@ unit aoptbase;
|
||||
If Not(Assigned(Current)) or
|
||||
(Current.typ In SkipInstr) or
|
||||
((Current.typ = ait_label) And
|
||||
Not(Tai_Label(Current).labsym.is_used)) or
|
||||
labelCanBeSkipped(Tai_Label(Current))) or
|
||||
((Current.typ = ait_Marker) And
|
||||
(Tai_Marker(Current).Kind = mark_AsmBlockEnd))
|
||||
Then
|
||||
|
Loading…
Reference in New Issue
Block a user