* fixed relabeling (nextaltnr was never increased)

* fixed inlining of case statements at the node level
This commit is contained in:
Jonas Maebe 2004-07-22 10:07:09 +00:00
parent ebead1b5ee
commit 038a5dde80
2 changed files with 25 additions and 5 deletions

View File

@ -92,6 +92,7 @@ interface
function is_used:boolean;
procedure increfs;
procedure decrefs;
function getrefs: longint;
procedure setaddress(_pass:byte;sec:TAsmSection;offset,len:aint);
end;
@ -315,6 +316,12 @@ implementation
end;
function tasmsymbol.getrefs: longint;
begin
getrefs := refs;
end;
procedure tasmsymbol.setaddress(_pass:byte;sec:TAsmSection;offset,len:aint);
begin
if (_pass=pass) then
@ -829,6 +836,7 @@ implementation
if not assigned(p.altsymbol) then
begin
p.altsymbol:=tasmsymbol.create(name+'_'+tostr(nextaltnr),p.defbind,p.typ);
inc(nextaltnr);
symbolsearch.insert(p.altsymbol);
{ add also the original sym to the usedasmsymbollist,
that list is used to reset the altsymbol }
@ -942,7 +950,11 @@ implementation
end.
{
$Log$
Revision 1.19 2004-06-20 08:55:28 florian
Revision 1.20 2004-07-22 10:07:09 jonas
* fixed relabeling (nextaltnr was never increased)
* fixed inlining of case statements at the node level
Revision 1.19 2004/06/20 08:55:28 florian
* logs truncated
Revision 1.18 2004/06/16 20:07:06 florian

View File

@ -768,14 +768,18 @@ implementation
max_dist,
dist : aword;
hp : tstatementnode;
relabeling: boolean;
begin
location_reset(location,LOC_VOID,OS_NO);
{ Relabel for inlining? }
if inlining_procedure and assigned(nodes) then
relabeling := false;
if assigned(nodes) and
(nodes^.statement.getrefs <> 0) then
begin
objectlibrary.CreateUsedAsmSymbolList;
relabelcaserecord(nodes);
relabeling := true;
end;
objectlibrary.getlabel(endlabel);
@ -926,7 +930,7 @@ implementation
while assigned(hp) do
begin
{ relabel when inlining }
if inlining_procedure then
if relabeling then
begin
if hp.left.nodetype<>labeln then
internalerror(200211261);
@ -953,7 +957,7 @@ implementation
cg.a_label(exprasmlist,endlabel);
{ Remove relabels for inlining }
if inlining_procedure and
if relabeling and
assigned(nodes) then
begin
{ restore used symbols }
@ -970,7 +974,11 @@ begin
end.
{
$Log$
Revision 1.64 2004-07-04 12:38:55 jonas
Revision 1.65 2004-07-22 10:07:09 jonas
* fixed relabeling (nextaltnr was never increased)
* fixed inlining of case statements at the node level
Revision 1.64 2004/07/04 12:38:55 jonas
* fixed regvar bug in tcginnode.pass_2
Revision 1.63 2004/06/20 08:55:29 florian