* 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;
{$i defines.inc}
interface
uses
@ -71,7 +74,7 @@ interface
ttypenode = class(tnode)
typenodetype : pdef;
typenodesym:ptypesym
typenodesym:ptypesym;
constructor create(t : pdef;sym:ptypesym);virtual;
function getcopy : tnode;override;
function pass_1 : tnode;override;
@ -85,7 +88,11 @@ interface
carrayconstructnode : class of tarrayconstructnode;
ctypenode : class of ttypenode;
function genloadnode(v : pvarsym;st : psymtable) : tloadnode;
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
@ -108,8 +115,64 @@ implementation
function genloadnode(v : pvarsym;st : psymtable) : tloadnode;
var
n : tloadnode;
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;
function gentypenode(t : pdef;sym:ptypesym) : ttypenode;
@ -690,7 +753,9 @@ begin
end.
{
$Log$
Revision 1.1 2000-09-25 14:55:05 florian
* initial revision
Revision 1.2 2000-09-25 15:37:14 florian
* more fixes
Revision 1.1 2000/09/25 14:55:05 florian
* initial revision
}

View File

@ -130,7 +130,7 @@ implementation
globtype,systems,
cutils,cobjects,verbose,globals,
symconst,aasm,types,
htypechk,pass_1,ncal
htypechk,pass_1,ncal,nld
{$ifdef newcg}
,cgbase
{$else newcg}
@ -884,7 +884,10 @@ implementation
end.
{
$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
Revision 1.1 2000/09/25 09:58:22 florian

View File

@ -204,7 +204,10 @@
nf_cargs,
nf_cargswap,
nf_forcevaria,
nf_novariaallowed
nf_novariaallowed,
{ ttypeconvnode }
nf_explizit
);
tnodeflagset = set of tnodeflags;
@ -320,7 +323,10 @@
{
$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
Revision 1.4 2000/09/24 21:15:34 florian