* fixed value openarray

* ungettemp of arrayconstruct
This commit is contained in:
peter 1998-10-01 09:22:52 +00:00
parent 088781a22d
commit 2b44a66b5a
3 changed files with 63 additions and 24 deletions

View File

@ -613,6 +613,7 @@ implementation
i : longint;
{ help reference pointer }
r : preference;
hp,
pp,params : ptree;
inlined : boolean;
inlinecode : ptree;
@ -1313,9 +1314,24 @@ implementation
while assigned(pp) do
begin
if assigned(pp^.left) then
if (pp^.left^.location.loc=LOC_REFERENCE) or
(pp^.left^.location.loc=LOC_MEM) then
ungetiftemp(pp^.left^.location.reference);
begin
if pp^.left^.location.loc in [LOC_REFERENCE,LOC_MEM] then
ungetiftemp(pp^.left^.location.reference);
{ process also all nodes of an array of const }
if pp^.left^.treetype=arrayconstructn then
begin
if assigned(pp^.left^.left) then
begin
hp:=pp^.left;
while assigned(hp) do
begin
if hp^.left^.location.loc in [LOC_REFERENCE,LOC_MEM] then
ungetiftemp(hp^.left^.location.reference);
hp:=hp^.right;
end;
end;
end;
end;
pp:=pp^.right;
end;
if inlined then
@ -1437,7 +1453,11 @@ implementation
end.
{
$Log$
Revision 1.31 1998-09-28 16:57:15 pierre
Revision 1.32 1998-10-01 09:22:52 peter
* fixed value openarray
* ungettemp of arrayconstruct
Revision 1.31 1998/09/28 16:57:15 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer

View File

@ -608,23 +608,28 @@ implementation
end;
procedure emit_lea_tree_ref(const p:ptree;const ref:treference);
var
href : treference;
t : tlocation;
procedure emit_to_reference(var p:ptree);
begin
t:=p^.location;
case t.loc of
case p^.location.loc of
LOC_FPU : begin
reset_reference(href);
gettempofsizereference(10,href);
floatstore(pfloatdef(p^.resulttype)^.typ,href);
exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L,
newreference(href),R_EDI)));
exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,
R_EDI,newreference(ref))));
reset_reference(p^.location.reference);
gettempofsizereference(10,p^.location.reference);
floatstore(pfloatdef(p^.resulttype)^.typ,p^.location.reference);
p^.location.loc:=LOC_REFERENCE;
end;
LOC_MEM,
LOC_REFERENCE : ;
else
internalerror(333);
end;
end;
procedure emit_lea_loc_ref(const t:tlocation;const ref:treference);
begin
case t.loc of
LOC_MEM,
LOC_REFERENCE : begin
if t.reference.isintvalue then
internalerror(331)
@ -710,7 +715,10 @@ implementation
inc(href.offset,4);
{ write changing field update href to the next element }
if vaddr then
emit_lea_tree_ref(hp^.left,href)
begin
emit_to_reference(hp^.left);
emit_lea_loc_ref(hp^.left^.location,href)
end
else
emit_mov_loc_ref(hp^.left^.location,href);
inc(href.offset,4);
@ -723,7 +731,11 @@ implementation
end.
{
$Log$
Revision 1.21 1998-09-28 11:07:39 peter
Revision 1.22 1998-10-01 09:22:53 peter
* fixed value openarray
* ungettemp of arrayconstruct
Revision 1.21 1998/09/28 11:07:39 peter
+ floatdef support for array of const
Revision 1.20 1998/09/24 14:26:03 peter

View File

@ -942,12 +942,15 @@
if assigned(definition) then
begin
case varspez of
vs_value : getsize:=definition^.size;
vs_value : begin
if is_open_array(definition) then
getsize:=sizeof(pointer)+4
else
getsize:=definition^.size;
end;
vs_var : begin
{ open arrays push also the high valye }
if (definition^.deftype=arraydef) and
(parraydef(definition)^.lowrange=0) and
(parraydef(definition)^.highrange=-1) then
if is_open_array(definition) then
getsize:=sizeof(pointer)+4
else
getsize:=sizeof(pointer);
@ -1716,7 +1719,11 @@
{
$Log$
Revision 1.48 1998-09-26 17:45:44 peter
Revision 1.49 1998-10-01 09:22:55 peter
* fixed value openarray
* ungettemp of arrayconstruct
Revision 1.48 1998/09/26 17:45:44 peter
+ idtoken and only one token table
Revision 1.47 1998/09/24 15:11:17 peter