* more fixes

This commit is contained in:
florian 2000-09-25 15:37:14 +00:00
parent 7549cdd6cc
commit df4eb26ed0
4 changed files with 1168 additions and 8 deletions

1086
compiler/ncnv.pas Normal file

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,9 @@
**************************************************************************** ****************************************************************************
} }
unit nld; unit nld;
{$i defines.inc}
interface interface
uses uses
@ -71,7 +74,7 @@ interface
ttypenode = class(tnode) ttypenode = class(tnode)
typenodetype : pdef; typenodetype : pdef;
typenodesym:ptypesym typenodesym:ptypesym;
constructor create(t : pdef;sym:ptypesym);virtual; constructor create(t : pdef;sym:ptypesym);virtual;
function getcopy : tnode;override; function getcopy : tnode;override;
function pass_1 : tnode;override; function pass_1 : tnode;override;
@ -85,7 +88,11 @@ interface
carrayconstructnode : class of tarrayconstructnode; carrayconstructnode : class of tarrayconstructnode;
ctypenode : class of ttypenode; ctypenode : class of ttypenode;
function genloadnode(v : pvarsym;st : psymtable) : tloadnode;
function gentypenode(t : pdef;sym:ptypesym) : ttypenode; function gentypenode(t : pdef;sym:ptypesym) : ttypenode;
function genloadcallnode(v: pprocsym;st: psymtable): tloadnode;
function genloadmethodcallnode(v: pprocsym;st: psymtable; mp: tnode): tloadnode;
function gentypedconstloadnode(sym : ptypedconstsym;st : psymtable) : tloadnode;
implementation implementation
@ -108,8 +115,64 @@ implementation
function genloadnode(v : pvarsym;st : psymtable) : tloadnode; function genloadnode(v : pvarsym;st : psymtable) : tloadnode;
var
n : tloadnode;
begin begin
genloadnode:=cloadnode.create(v,st); n:=cloadnode.create(v,st);
{$fidef NEWST}
n.resulttype:=v^.definition;
{$else NEWST}
n.resulttype:=v^.vartype.def;
{$endif NEWST}
genloadnode:=n:
end;
function genloadcallnode(v: pprocsym;st: psymtable): tloadnode;
var
n : tloadnode;
begin
n:=cloadnode.create(v,st);
{$ifdef NEWST}
n.resulttype:=nil; {We don't know which overloaded procedure is
wanted...}
{$else NEWST}
n.resulttype:=v^.definition;
{$endif NEWST}
genloadcallnode:=n;
end;
function genloadmethodcallnode(v: pprocsym;st: psymtable; mp: tnode): tloadnode;
var
n : tloadnode;
begin
n:=cloadnode.create(v,st);
{$ifdef NEWST}
n.resulttype:=nil; {We don't know which overloaded procedure is
wanted...}
{$else NEWST}
n.resulttype:=v^.definition;
{$endif NEWST}
p^.left:=mp;
genloadmethodcallnode:=v;
end;
function gentypedconstloadnode(sym : ptypedconstsym;st : psymtable) : tloadnode;
var
n : tloadnode;
begin
n:=cloadnode.create(sym,st);
{$ifdef NEWST}
n.resulttype:=sym^.definition;
{$else NEWST}
n.resulttype:=sym^.typedconsttype.def;
{$endif NEWST}
gentypedconstloadnode:=n;
end; end;
function gentypenode(t : pdef;sym:ptypesym) : ttypenode; function gentypenode(t : pdef;sym:ptypesym) : ttypenode;
@ -690,7 +753,9 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.1 2000-09-25 14:55:05 florian Revision 1.2 2000-09-25 15:37:14 florian
* initial revision * more fixes
Revision 1.1 2000/09/25 14:55:05 florian
* initial revision
} }

View File

@ -130,7 +130,7 @@ implementation
globtype,systems, globtype,systems,
cutils,cobjects,verbose,globals, cutils,cobjects,verbose,globals,
symconst,aasm,types, symconst,aasm,types,
htypechk,pass_1,ncal htypechk,pass_1,ncal,nld
{$ifdef newcg} {$ifdef newcg}
,cgbase ,cgbase
{$else newcg} {$else newcg}
@ -884,7 +884,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.2 2000-09-25 15:05:25 florian Revision 1.3 2000-09-25 15:37:14 florian
* more fixes
Revision 1.2 2000/09/25 15:05:25 florian
* some updates * some updates
Revision 1.1 2000/09/25 09:58:22 florian Revision 1.1 2000/09/25 09:58:22 florian

View File

@ -204,7 +204,10 @@
nf_cargs, nf_cargs,
nf_cargswap, nf_cargswap,
nf_forcevaria, nf_forcevaria,
nf_novariaallowed nf_novariaallowed,
{ ttypeconvnode }
nf_explizit
); );
tnodeflagset = set of tnodeflags; tnodeflagset = set of tnodeflags;
@ -320,7 +323,10 @@
{ {
$Log$ $Log$
Revision 1.5 2000-09-25 15:05:25 florian Revision 1.6 2000-09-25 15:37:14 florian
* more fixes
Revision 1.5 2000/09/25 15:05:25 florian
* some updates * some updates
Revision 1.4 2000/09/24 21:15:34 florian Revision 1.4 2000/09/24 21:15:34 florian