mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-19 21:58:23 +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}
|
{$endif RefsHaveIndexReg}
|
||||||
End;
|
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;
|
Function TAOptBase.GetNextInstruction(Current: tai; Var Next: tai): Boolean;
|
||||||
Begin
|
Begin
|
||||||
Repeat
|
Repeat
|
||||||
@ -153,7 +158,7 @@ unit aoptbase;
|
|||||||
) or
|
) or
|
||||||
{$endif SPARC}
|
{$endif SPARC}
|
||||||
((Current.typ = ait_label) And
|
((Current.typ = ait_label) And
|
||||||
Not(Tai_Label(Current).labsym.is_used))) Do
|
labelCanBeSkipped(Tai_Label(Current)))) Do
|
||||||
Current := tai(Current.Next);
|
Current := tai(Current.Next);
|
||||||
If Assigned(Current) And
|
If Assigned(Current) And
|
||||||
(Current.typ = ait_Marker) And
|
(Current.typ = ait_Marker) And
|
||||||
@ -171,7 +176,7 @@ unit aoptbase;
|
|||||||
If Assigned(Current) And
|
If Assigned(Current) And
|
||||||
Not((Current.typ In SkipInstr) or
|
Not((Current.typ In SkipInstr) or
|
||||||
((Current.typ = ait_label) And
|
((Current.typ = ait_label) And
|
||||||
Not(Tai_Label(Current).labsym.is_used)))
|
labelCanBeSkipped(Tai_Label(Current))))
|
||||||
Then GetNextInstruction := True
|
Then GetNextInstruction := True
|
||||||
Else
|
Else
|
||||||
Begin
|
Begin
|
||||||
@ -189,7 +194,7 @@ unit aoptbase;
|
|||||||
Not(Tai_Marker(Current).Kind in [mark_AsmBlockEnd,mark_NoPropInfoEnd])) or
|
Not(Tai_Marker(Current).Kind in [mark_AsmBlockEnd,mark_NoPropInfoEnd])) or
|
||||||
(Current.typ In SkipInstr) or
|
(Current.typ In SkipInstr) or
|
||||||
((Current.typ = ait_label) And
|
((Current.typ = ait_label) And
|
||||||
Not(Tai_Label(Current).labsym.is_used))) Do
|
labelCanBeSkipped(Tai_Label(Current)))) Do
|
||||||
Current := Tai(Current.previous);
|
Current := Tai(Current.previous);
|
||||||
If Assigned(Current) And
|
If Assigned(Current) And
|
||||||
(Current.typ = ait_Marker) And
|
(Current.typ = ait_Marker) And
|
||||||
@ -206,7 +211,7 @@ unit aoptbase;
|
|||||||
If Not(Assigned(Current)) or
|
If Not(Assigned(Current)) or
|
||||||
(Current.typ In SkipInstr) or
|
(Current.typ In SkipInstr) or
|
||||||
((Current.typ = ait_label) And
|
((Current.typ = ait_label) And
|
||||||
Not(Tai_Label(Current).labsym.is_used)) or
|
labelCanBeSkipped(Tai_Label(Current))) or
|
||||||
((Current.typ = ait_Marker) And
|
((Current.typ = ait_Marker) And
|
||||||
(Tai_Marker(Current).Kind = mark_AsmBlockEnd))
|
(Tai_Marker(Current).Kind = mark_AsmBlockEnd))
|
||||||
Then
|
Then
|
||||||
|
Loading…
Reference in New Issue
Block a user