* only small updates to work with the current compiler

This commit is contained in:
florian 1999-09-14 11:16:09 +00:00
parent e73862f10d
commit 134030a529
4 changed files with 80 additions and 35 deletions

View File

@ -180,7 +180,7 @@ unit cgobj;
implementation implementation
uses uses
globals,globtype,options,files,gdb,systems, strings,globals,globtype,options,files,gdb,systems,
ppu,verbose,types,tgobj,tgcpu; ppu,verbose,types,tgobj,tgcpu;
{***************************************************************************** {*****************************************************************************
@ -1080,7 +1080,10 @@ unit cgobj;
end. end.
{ {
$Log$ $Log$
Revision 1.25 1999-09-03 13:09:09 jonas Revision 1.26 1999-09-14 11:16:09 florian
* only small updates to work with the current compiler
Revision 1.25 1999/09/03 13:09:09 jonas
* fixed typo regarding scratchregs pointer * fixed typo regarding scratchregs pointer
Revision 1.24 1999/08/26 14:51:54 jonas Revision 1.24 1999/08/26 14:51:54 jonas

View File

@ -38,28 +38,45 @@ unit convtree;
function convtree2node(p : ptree) : pnode; function convtree2node(p : ptree) : pnode;
var function doconv(p : ptree) : pnode;
node : pnode;
var
node : pnode;
begin
if assigned(p) then
begin
case p^.treetype of
blockn:
node:=new(pblocknode,init(doconv(p^.left)));
assignn:
node:=new(passignmentnode,init(doconv(p^.left),
doconv(p^.right)));
statementn:
node:=new(pstatementnode,init(doconv(p^.left),
doconv(p^.right)));
loadn:
node:=new(ploadnode,init(p^.symtableentry,p^.symtable));
else internalerror(1209993);
end;
doconv:=node;
end
else
doconv:=nil;
end;
begin begin
if assigned(p) then convtree2node:=doconv(p);
begin disposetree(p);
case p^.treetype of
blockn:
node:=new(pblocknode,init(convtree2node(p^.left)));
else internalerror(13751);
end;
disposetree(p);
convtree2node:=node;
end
else
convtree2node:=nil;
end; end;
end. end.
{ {
$Log$ $Log$
Revision 1.4 1999-01-24 22:32:35 florian Revision 1.5 1999-09-14 11:16:09 florian
* only small updates to work with the current compiler
Revision 1.4 1999/01/24 22:32:35 florian
* well, more changes, especially parts of secondload ported * well, more changes, especially parts of secondload ported
Revision 1.3 1999/01/23 23:29:47 florian Revision 1.3 1999/01/23 23:29:47 florian

View File

@ -33,7 +33,7 @@ unit nmem;
symtableentry : psym; symtableentry : psym;
symtable : psymtable; symtable : psymtable;
is_absolute,is_first,is_methodpointer : boolean; is_absolute,is_first,is_methodpointer : boolean;
constructor init(v : pvarsym;st : psymtable); constructor init(v : psym;st : psymtable);
destructor done;virtual; destructor done;virtual;
procedure det_temp;virtual; procedure det_temp;virtual;
procedure det_resulttype;virtual; procedure det_resulttype;virtual;
@ -70,7 +70,7 @@ unit nmem;
TLOADNODE TLOADNODE
****************************************************************************} ****************************************************************************}
constructor tloadnode.init(v : pvarsym;st : psymtable); constructor tloadnode.init(v : psym;st : psymtable);
var var
p : ptree; p : ptree;
@ -78,7 +78,8 @@ unit nmem;
begin begin
inherited init; inherited init;
treetype:=loadn; treetype:=loadn;
resulttype:=v^.definition; if v^.typ=varsym then
resulttype:=pvarsym(v)^.definition;
symtableentry:=v; symtableentry:=v;
symtable:=st; symtable:=st;
is_first := False; is_first := False;
@ -142,7 +143,7 @@ unit nmem;
location.reference.symbol:=newasmsymbol(symtableentry^.mangledname); location.reference.symbol:=newasmsymbol(symtableentry^.mangledname);
end end
{$ifdef i386} {$ifdef dummy}
{ DLL variable, DLL variables are only available on the win32 target } { DLL variable, DLL variables are only available on the win32 target }
{ maybe we've to add this later for the alpha WinNT } { maybe we've to add this later for the alpha WinNT }
else if (pvarsym(symtableentry)^.var_options and vo_is_dll_var)<>0 then else if (pvarsym(symtableentry)^.var_options and vo_is_dll_var)<>0 then
@ -153,10 +154,10 @@ unit nmem;
location.reference.symbol:=nil; location.reference.symbol:=nil;
location.reference.base:=hregister; location.reference.base:=hregister;
end end
{$endif i386} {$endif dummy}
else else
begin begin
{$ifdef i386} {$ifdef dummy}
symtabletype:=symtable^.symtabletype; symtabletype:=symtable^.symtabletype;
{ in case it is a register variable: } { in case it is a register variable: }
if pvarsym(symtableentry)^.reg<>R_NO then if pvarsym(symtableentry)^.reg<>R_NO then
@ -289,7 +290,7 @@ unit nmem;
reset_reference(location.reference); reset_reference(location.reference);
location.reference.base:=hregister; location.reference.base:=hregister;
end; end;
{$endif i386} {$endif dummy}
end; end;
end; end;
procsym: procsym:
@ -412,6 +413,7 @@ unit nmem;
var var
r : treference; r : treference;
opsize : tcgsize;
begin begin
if left^.resulttype^.deftype=stringdef then if left^.resulttype^.deftype=stringdef then
@ -466,12 +468,12 @@ unit nmem;
(loc=LOC_CREGISTER) then (loc=LOC_CREGISTER) then
begin begin
case p^.left^.resulttype^.size of case p^.left^.resulttype^.size of
1 : opsize:=S_B; 1 : opsize:=OS_B;
2 : opsize:=S_W; 2 : opsize:=OS_W;
4 : opsize:=S_L; 4 : opsize:=OS_L;
{ S_L is correct, the copy is done } { S_L is correct, the copy is done }
{ with two moves } { with two moves }
8 : opsize:=S_L; 8 : opsize:=OS_L;
end; end;
if loc=LOC_CREGISTER then if loc=LOC_CREGISTER then
begin begin
@ -709,7 +711,10 @@ unit nmem;
end. end.
{ {
$Log$ $Log$
Revision 1.11 1999-08-25 12:00:12 jonas Revision 1.12 1999-09-14 11:16:09 florian
* only small updates to work with the current compiler
Revision 1.11 1999/08/25 12:00:12 jonas
* changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu) * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
Revision 1.10 1999/08/18 17:05:56 florian Revision 1.10 1999/08/18 17:05:56 florian
@ -744,5 +749,4 @@ end.
Revision 1.1 1999/01/24 22:32:36 florian Revision 1.1 1999/01/24 22:32:36 florian
* well, more changes, especially parts of secondload ported * well, more changes, especially parts of secondload ported
}
}

View File

@ -218,8 +218,8 @@ unit tree;
end; end;
{ allows to determine which elementes are to be replaced } { allows to determine which elementes are to be replaced }
tdisposetyp = (dt_nothing,dt_leftright,dt_left, tdisposetyp = (dt_nothing,dt_leftright,dt_left,dt_leftrighthigh,
dt_mbleft,dt_typeconv,dt_inlinen, dt_mbleft,dt_typeconv,dt_inlinen,dt_leftrightmethod,
dt_mbleft_and_method,dt_loop,dt_case,dt_with,dt_onn); dt_mbleft_and_method,dt_loop,dt_case,dt_with,dt_onn);
ptree = ^ttree; ptree = ^ttree;
@ -789,6 +789,24 @@ unit tree;
if assigned(p^.right) then if assigned(p^.right) then
disposetree(p^.right); disposetree(p^.right);
end; end;
dt_leftrighthigh :
begin
if assigned(p^.left) then
disposetree(p^.left);
if assigned(p^.right) then
disposetree(p^.right);
if assigned(p^.hightree) then
disposetree(p^.hightree);
end;
dt_leftrightmethod :
begin
if assigned(p^.left) then
disposetree(p^.left);
if assigned(p^.right) then
disposetree(p^.right);
if assigned(p^.methodpointer) then
disposetree(p^.methodpointer);
end;
dt_case : dt_case :
begin begin
if assigned(p^.left) then if assigned(p^.left) then
@ -853,7 +871,7 @@ unit tree;
symt:=p^.withsymtable; symt:=p^.withsymtable;
end; end;
end; end;
else internalerror(12); else internalerror(1209995);
end; end;
putnode(p); putnode(p);
end; end;
@ -2000,7 +2018,10 @@ unit tree;
end. end.
{ {
$Log$ $Log$
Revision 1.13 1999-08-06 18:05:55 florian Revision 1.14 1999-09-14 11:16:09 florian
* only small updates to work with the current compiler
Revision 1.13 1999/08/06 18:05:55 florian
* implemented some stuff for assignments * implemented some stuff for assignments
Revision 1.12 1999/08/05 14:58:16 florian Revision 1.12 1999/08/05 14:58:16 florian