* gen_high_tree now uses an inline node of type in_high_x in most cases

so that it doesn't duplicate any code anymore from ninl.pas (and
    dynamic array support was still missing)
This commit is contained in:
Jonas Maebe 2001-12-10 14:28:47 +00:00
parent e5f6ff03cb
commit 8ddb738e07

View File

@ -539,6 +539,7 @@ implementation
procedure tcallparanode.gen_high_tree(openstring:boolean); procedure tcallparanode.gen_high_tree(openstring:boolean);
var var
temp: tnode;
len : longint; len : longint;
st : tsymtable; st : tsymtable;
loadconst : boolean; loadconst : boolean;
@ -551,34 +552,25 @@ implementation
case left.resulttype.def.deftype of case left.resulttype.def.deftype of
arraydef : arraydef :
begin begin
if is_open_array(left.resulttype.def) or { handle via a normal inline in_high_x node }
is_array_of_const(left.resulttype.def) then loadconst := false;
begin hightree := geninlinenode(in_high_x,false,left.getcopy);
st:=tloadnode(left).symtable; { only substract low(array) if it's <> 0 }
srsym:=searchsymonlyin(st,'high'+tvarsym(tloadnode(left).symtableentry).name); temp := geninlinenode(in_low_x,false,left.getcopy);
hightree:=cloadnode.create(tvarsym(srsym),st); firstpass(temp);
loadconst:=false; if (temp.nodetype <> ordconstn) or
end (tordconstnode(temp).value <> 0) then
hightree := caddnode.create(subn,hightree,temp)
else else
begin temp.free;
{ this is an empty constructor }
len:=tarraydef(left.resulttype.def).highrange-
tarraydef(left.resulttype.def).lowrange;
end;
end; end;
stringdef : stringdef :
begin begin
if openstring then if openstring then
begin begin
if is_open_string(left.resulttype.def) then { handle via a normal inline in_high_x node }
begin loadconst := false;
st:=tloadnode(left).symtable; hightree := geninlinenode(in_high_x,false,left.getcopy);
srsym:=searchsymonlyin(st,'high'+tvarsym(tloadnode(left).symtableentry).name);
hightree:=cloadnode.create(tvarsym(srsym),st);
loadconst:=false;
end
else
len:=tstringdef(left.resulttype.def).len;
end end
else else
{ passing a string to an array of char } { passing a string to an array of char }
@ -593,7 +585,10 @@ implementation
begin begin
hightree:=caddnode.create(subn,geninlinenode(in_length_x,false,left.getcopy), hightree:=caddnode.create(subn,geninlinenode(in_length_x,false,left.getcopy),
cordconstnode.create(1,s32bittype)); cordconstnode.create(1,s32bittype));
{
not necessary (JM)
firstpass(hightree); firstpass(hightree);
}
hightree:=ctypeconvnode.create(hightree,s32bittype); hightree:=ctypeconvnode.create(hightree,s32bittype);
loadconst:=false; loadconst:=false;
end; end;
@ -1763,7 +1758,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.58 2001-11-20 18:49:43 peter Revision 1.59 2001-12-10 14:28:47 jonas
* gen_high_tree now uses an inline node of type in_high_x in most cases
so that it doesn't duplicate any code anymore from ninl.pas (and
dynamic array support was still missing)
Revision 1.58 2001/11/20 18:49:43 peter
* require overload for cross object overloading * require overload for cross object overloading
Revision 1.57 2001/11/18 20:18:54 peter Revision 1.57 2001/11/18 20:18:54 peter