mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-04 04:17:53 +01:00
* high(arrayconstructor) is now correct
* procvardef support for variant record
This commit is contained in:
parent
5698c63628
commit
3be1a61de4
@ -254,8 +254,6 @@ implementation
|
||||
hregister : tregister;
|
||||
loc : tloc;
|
||||
r : preference;
|
||||
pushed : tpushed;
|
||||
|
||||
begin
|
||||
otlabel:=truelabel;
|
||||
oflabel:=falselabel;
|
||||
@ -583,7 +581,7 @@ implementation
|
||||
vtWideString = 15;
|
||||
vtInt64 = 16;
|
||||
|
||||
procedure emit_mov_value_ref(const t:tlocation;const ref:treference);
|
||||
procedure emit_mov_loc_ref(const t:tlocation;const ref:treference);
|
||||
begin
|
||||
case t.loc of
|
||||
LOC_REGISTER,
|
||||
@ -610,7 +608,7 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure emit_mov_addr_ref(const t:tlocation;const ref:treference);
|
||||
procedure emit_lea_loc_ref(const t:tlocation;const ref:treference);
|
||||
begin
|
||||
case t.loc of
|
||||
LOC_MEM,
|
||||
@ -635,12 +633,11 @@ implementation
|
||||
var
|
||||
hp : ptree;
|
||||
href : treference;
|
||||
hreg : tregister;
|
||||
lt : pdef;
|
||||
vtype : longint;
|
||||
begin
|
||||
clear_reference(p^.location.reference);
|
||||
gettempofsizereference(parraydef(p^.resulttype)^.highrange*8,p^.location.reference);
|
||||
gettempofsizereference((parraydef(p^.resulttype)^.highrange+1)*8,p^.location.reference);
|
||||
hp:=p;
|
||||
href:=p^.location.reference;
|
||||
while assigned(hp) do
|
||||
@ -663,30 +660,39 @@ implementation
|
||||
else
|
||||
if (lt^.deftype=orddef) and (porddef(lt)^.typ=uchar) then
|
||||
vtype:=vtChar;
|
||||
emit_mov_value_ref(hp^.left^.location,href);
|
||||
emit_mov_loc_ref(hp^.left^.location,href);
|
||||
end;
|
||||
floatdef : begin
|
||||
vtype:=vtExtended;
|
||||
emit_lea_loc_ref(hp^.left^.location,href);
|
||||
end;
|
||||
procvardef,
|
||||
pointerdef : begin
|
||||
if is_pchar(lt) then
|
||||
vtype:=vtPChar
|
||||
else
|
||||
vtype:=vtPointer;
|
||||
emit_mov_value_ref(hp^.left^.location,href);
|
||||
emit_mov_loc_ref(hp^.left^.location,href);
|
||||
end;
|
||||
classrefdef : begin
|
||||
vtype:=vtClass;
|
||||
emit_mov_value_ref(hp^.left^.location,href);
|
||||
emit_mov_loc_ref(hp^.left^.location,href);
|
||||
end;
|
||||
objectdef : begin
|
||||
vtype:=vtObject;
|
||||
emit_mov_loc_ref(hp^.left^.location,href);
|
||||
end;
|
||||
stringdef : begin
|
||||
if is_shortstring(lt) then
|
||||
begin
|
||||
vtype:=vtString;
|
||||
emit_mov_addr_ref(hp^.left^.location,href);
|
||||
emit_lea_loc_ref(hp^.left^.location,href);
|
||||
end
|
||||
else
|
||||
if is_ansistring(lt) then
|
||||
begin
|
||||
vtype:=vtAnsiString;
|
||||
emit_mov_value_ref(hp^.left^.location,href);
|
||||
emit_mov_loc_ref(hp^.left^.location,href);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -707,7 +713,11 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.18 1998-09-23 09:58:48 peter
|
||||
Revision 1.19 1998-09-23 17:49:59 peter
|
||||
* high(arrayconstructor) is now correct
|
||||
* procvardef support for variant record
|
||||
|
||||
Revision 1.18 1998/09/23 09:58:48 peter
|
||||
* first working array of const things
|
||||
|
||||
Revision 1.17 1998/09/20 18:00:19 florian
|
||||
|
||||
@ -338,6 +338,12 @@ unit pass_1;
|
||||
while assigned(hp) do
|
||||
begin
|
||||
firstpass(hp^.left);
|
||||
case hp^.left^.resulttype^.deftype of
|
||||
floatdef : begin
|
||||
gentypeconvnode(hp^.left,s80floatdef);
|
||||
firstpass(hp^.left);
|
||||
end;
|
||||
end;
|
||||
if (pd=nil) then
|
||||
pd:=hp^.left^.resulttype
|
||||
else
|
||||
@ -349,11 +355,9 @@ unit pass_1;
|
||||
inc(len);
|
||||
hp:=hp^.right;
|
||||
end;
|
||||
if len=0 then
|
||||
Internalerror(4235);
|
||||
end;
|
||||
calcregisters(p,0,0,0);
|
||||
p^.resulttype:=new(parraydef,init(0,len,pd));
|
||||
p^.resulttype:=new(parraydef,init(0,len-1,pd));
|
||||
parraydef(p^.resulttype)^.IsConstructor:=true;
|
||||
parraydef(p^.resulttype)^.IsVariant:=varia;
|
||||
p^.location.loc:=LOC_REFERENCE;
|
||||
@ -5790,7 +5794,11 @@ unit pass_1;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.92 1998-09-23 15:46:37 florian
|
||||
Revision 1.93 1998-09-23 17:50:00 peter
|
||||
* high(arrayconstructor) is now correct
|
||||
* procvardef support for variant record
|
||||
|
||||
Revision 1.92 1998/09/23 15:46:37 florian
|
||||
* problem with with and classes fixed
|
||||
|
||||
Revision 1.91 1998/09/23 12:03:53 peter
|
||||
|
||||
Loading…
Reference in New Issue
Block a user