* fixed ppc compilation

git-svn-id: trunk@2778 -
This commit is contained in:
Jonas Maebe 2006-03-05 22:06:44 +00:00
parent d772104ce7
commit ab5f5ca15e
8 changed files with 44 additions and 30 deletions

View File

@ -592,6 +592,9 @@ interface
function Pass1(objdata:TObjData):longint;virtual;abstract;
procedure Pass2(objdata:TObjData);virtual;abstract;
procedure resetpass1; virtual;
procedure resetpass2; virtual;
end;
tai_cpu_class = class of tai_cpu_abstract;
@ -2365,6 +2368,16 @@ implementation
end;
procedure tai_cpu_abstract.resetpass1;
begin
end;
procedure tai_cpu_abstract.resetpass2;
begin
end;
{****************************************************************************
tai_align_abstract
****************************************************************************}

View File

@ -86,13 +86,13 @@ Unit aopt;
(tai_Marker(P).Kind <> AsmBlockStart)) Do
Begin
If (p.typ = ait_label) Then
If (tai_Label(p).l.is_used) Then
If (tai_Label(p).labsym.is_used) Then
Begin
LabelFound := True;
If (tai_Label(p).l.labelnr < LowLabel) Then
LowLabel := tai_Label(p).l.labelnr;
If (tai_Label(p).l.labelnr > HighLabel) Then
HighLabel := tai_Label(p).l.labelnr
If (tai_Label(p).labsym.labelnr < LowLabel) Then
LowLabel := tai_Label(p).labsym.labelnr;
If (tai_Label(p).labsym.labelnr > HighLabel) Then
HighLabel := tai_Label(p).labsym.labelnr
End;
prev := p;
GetNextInstruction(p, p)
@ -124,8 +124,8 @@ Unit aopt;
Begin
Case p.typ Of
ait_Label:
If tai_label(p).l.is_used Then
LabelTable^[tai_label(p).l.labelnr-LowLabel].PaiObj := p;
If tai_label(p).labsym.is_used Then
LabelTable^[tai_label(p).labsym.labelnr-LowLabel].PaiObj := p;
ait_regAlloc:
begin
{!!!!!!!!!

View File

@ -153,7 +153,7 @@ unit aoptbase;
) or
{$endif SPARC}
((Current.typ = ait_label) And
Not(Tai_Label(Current).l.is_used))) Do
Not(Tai_Label(Current).labsym.is_used))) Do
Current := tai(Current.Next);
If Assigned(Current) And
(Current.typ = ait_Marker) And
@ -171,7 +171,7 @@ unit aoptbase;
If Assigned(Current) And
Not((Current.typ In SkipInstr) or
((Current.typ = ait_label) And
Not(Tai_Label(Current).l.is_used)))
Not(Tai_Label(Current).labsym.is_used)))
Then GetNextInstruction := True
Else
Begin
@ -189,7 +189,7 @@ unit aoptbase;
Not(Tai_Marker(Current).Kind in [AsmBlockEnd,NoPropInfoEnd])) or
(Current.typ In SkipInstr) or
((Current.typ = ait_label) And
Not(Tai_Label(Current).l.is_used))) Do
Not(Tai_Label(Current).labsym.is_used))) Do
Current := Tai(Current.previous);
If Assigned(Current) And
(Current.typ = ait_Marker) And
@ -206,7 +206,7 @@ unit aoptbase;
If Not(Assigned(Current)) or
(Current.typ In SkipInstr) or
((Current.typ = ait_label) And
Not(Tai_Label(Current).l.is_used)) or
Not(Tai_Label(Current).labsym.is_used)) or
((Current.typ = ait_Marker) And
(Tai_Marker(Current).Kind = AsmBlockEnd))
Then

View File

@ -333,7 +333,7 @@ Unit AoptObj;
While Assigned(p) And
((p.typ in (SkipInstr - [ait_RegAlloc])) or
((p.typ = ait_label) And
Not(Tai_Label(p).l.is_used))) Do
Not(Tai_Label(p).labsym.is_used))) Do
p := Tai(p.next);
While Assigned(p) And
(p.typ=ait_RegAlloc) Do
@ -349,7 +349,7 @@ Unit AoptObj;
Until Not(Assigned(p)) Or
(Not(p.typ in SkipInstr) And
Not((p.typ = ait_label) And
Not(Tai_Label(p).l.is_used)));
Not(Tai_Label(p).labsym.is_used)));
End;
Function TUsedRegs.IsUsed(Reg: TRegister): Boolean;
@ -742,7 +742,7 @@ Unit AoptObj;
While Assigned(TempP) and
(TempP.typ In SkipInstr + [ait_label]) Do
If (TempP.typ <> ait_Label) Or
(Tai_label(TempP).l <> L)
(Tai_label(TempP).labsym <> L)
Then GetNextInstruction(TempP, TempP)
Else
Begin
@ -824,7 +824,7 @@ Unit AoptObj;
While Assigned(StartPai) And
((StartPai.typ in (SkipInstr - [ait_regAlloc])) Or
((StartPai.typ = ait_label) and
Not(Tai_Label(StartPai).l.Is_Used))) Do
Not(Tai_Label(StartPai).labsym.Is_Used))) Do
StartPai := Tai(StartPai.Next);
If Assigned(StartPai) And
(StartPai.typ = ait_regAlloc) and (tai_regalloc(StartPai).ratype=ra_alloc) Then
@ -871,7 +871,7 @@ Unit AoptObj;
(tai(hp.next).typ = ait_label) then
begin
FindAnyLabel := true;
l := tai_label(hp.next).l;
l := tai_label(hp.next).labsym;
end
end;
@ -1053,7 +1053,7 @@ Unit AoptObj;
if taicpu(p).opcode=aopt_condjmp then
begin
taicpu(p).condition:=inverse_cond(taicpu(p).condition);
tai_label(hp2).l.decrefs;
tai_label(hp2).labsym.decrefs;
taicpu(p).oper[0]^.ref^.symbol:=taicpu(hp1).oper[0]^.ref^.symbol;
{ when freeing hp1, the reference count
isn't decreased, so don't increase

View File

@ -451,9 +451,9 @@ uses cutils, cclasses;
begin
if p.typ = ait_label then
begin
if (tai_label(p).l.labelnr >= labelpositions.count) then
labelpositions.count := tai_label(p).l.labelnr * 2;
labelpositions[tai_label(p).l.labelnr] := pointer(instrpos);
if (tai_label(p).labsym.labelnr >= labelpositions.count) then
labelpositions.count := tai_label(p).labsym.labelnr * 2;
labelpositions[tai_label(p).labsym.labelnr] := pointer(instrpos);
end;
if p.typ = ait_instruction then
inc(instrpos);
@ -473,9 +473,9 @@ uses cutils, cclasses;
// of jumps
begin
// can happen because of newly inserted labels
if (tai_label(p).l.labelnr > labelpositions.count) then
labelpositions.count := tai_label(p).l.labelnr * 2;
labelpositions[tai_label(p).l.labelnr] := pointer(instrpos);
if (tai_label(p).labsym.labelnr > labelpositions.count) then
labelpositions.count := tai_label(p).labsym.labelnr * 2;
labelpositions[tai_label(p).labsym.labelnr] := pointer(instrpos);
end;
ait_instruction:
begin

View File

@ -73,7 +73,8 @@ interface
'csect', {data}
'csect', {read only data}
'csect', {bss} 'csect',
'csect','csect','csect','csect','','','','','','','','','','','','','',''
'csect','csect','csect','csect',
'','','','','','','','','','','',''
);
type
@ -1050,9 +1051,9 @@ interface
end;
ait_label:
begin
if tai_label(hp).l.is_used then
if tai_label(hp).labsym.is_used then
begin
s:= tai_label(hp).l.name;
s:= tai_label(hp).labsym.name;
if s[1] = '@' then
begin
ReplaceForbiddenChars(s);
@ -1129,7 +1130,7 @@ interface
replaced: boolean;
begin
if tasmsymbol(p).defbind=AB_EXTERNAL then
if tasmsymbol(p).bind=AB_EXTERNAL then
begin
//Writeln('ZZZ ',p.name,' ',p.classname,' ',Ord(tasmsymbol(p).typ));
s:= p.name;

View File

@ -2058,7 +2058,7 @@ const
if (target_info.system = system_powerpc_darwin) and
assigned(ref.symbol) and
(ref.symbol.defbind = AB_EXTERNAL) then
(ref.symbol.bind = AB_EXTERNAL) then
begin
tmpreg := g_darwin_indirect_sym_load(list,ref.symbol.name);
if (ref.base = NR_NO) then

View File

@ -236,8 +236,8 @@ interface
{$ifndef NOAG386BIN}
public
{ the next will reset all instructions that can change in pass 2 }
procedure ResetPass1;
procedure ResetPass2;
procedure ResetPass1;override;
procedure ResetPass2;override;
function CheckIfValid:boolean;
function Pass1(objdata:TObjData):longint;override;
procedure Pass2(objdata:TObjData);override;