* getposition added to retrieve the the current tai item

This commit is contained in:
peter 2003-06-09 12:20:47 +00:00
parent 65f03c3f7e
commit 47b691057b
2 changed files with 63 additions and 21 deletions

View File

@ -51,7 +51,10 @@ interface
tasmnode = class(tnode) tasmnode = class(tnode)
p_asm : taasmoutput; p_asm : taasmoutput;
currenttai : tai;
getposition : boolean;
constructor create(p : taasmoutput);virtual; constructor create(p : taasmoutput);virtual;
constructor create_get_position;
destructor destroy;override; destructor destroy;override;
constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override; constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
procedure ppuwrite(ppufile:tcompilerppufile);override; procedure ppuwrite(ppufile:tcompilerppufile);override;
@ -480,12 +483,23 @@ implementation
*****************************************************************************} *****************************************************************************}
constructor tasmnode.create(p : taasmoutput); constructor tasmnode.create(p : taasmoutput);
begin begin
inherited create(asmn); inherited create(asmn);
p_asm:=p; p_asm:=p;
getposition:=false;
currenttai:=nil;
end; end;
constructor tasmnode.create_get_position;
begin
inherited create(asmn);
p_asm:=nil;
getposition:=true;
currenttai:=nil;
end;
destructor tasmnode.destroy; destructor tasmnode.destroy;
begin begin
if assigned(p_asm) then if assigned(p_asm) then
@ -499,13 +513,20 @@ implementation
hp : tai; hp : tai;
begin begin
inherited ppuload(t,ppufile); inherited ppuload(t,ppufile);
p_asm:=taasmoutput.create; getposition:=boolean(ppufile.getbyte);
repeat if not getposition then
hp:=ppuloadai(ppufile); begin
if hp=nil then p_asm:=taasmoutput.create;
break; repeat
p_asm.concat(hp); hp:=ppuloadai(ppufile);
until false; if hp=nil then
break;
p_asm.concat(hp);
until false;
end
else
p_asm:=nil;
currenttai:=nil;
end; end;
@ -514,14 +535,18 @@ implementation
hp : tai; hp : tai;
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
hp:=tai(p_asm.first); ppufile.putbyte(byte(getposition));
while assigned(hp) do if not getposition then
begin begin
ppuwriteai(ppufile,hp); hp:=tai(p_asm.first);
hp:=tai(hp.next); while assigned(hp) do
end; begin
{ end is marked by a nil } ppuwriteai(ppufile,hp);
ppuwriteai(ppufile,nil); hp:=tai(hp.next);
end;
{ end is marked by a nil }
ppuwriteai(ppufile,nil);
end;
end; end;
@ -550,16 +575,21 @@ implementation
n.p_asm.concatlistcopy(p_asm); n.p_asm.concatlistcopy(p_asm);
end end
else n.p_asm := nil; else n.p_asm := nil;
n.getposition:=getposition;
n.currenttai:=currenttai;
getcopy := n; getcopy := n;
end; end;
function tasmnode.det_resulttype:tnode; function tasmnode.det_resulttype:tnode;
begin begin
result:=nil; result:=nil;
resulttype:=voidtype; resulttype:=voidtype;
include(current_procinfo.flags,pi_uses_asm); if not getposition then
include(current_procinfo.flags,pi_uses_asm);
end; end;
function tasmnode.pass_1 : tnode; function tasmnode.pass_1 : tnode;
begin begin
result:=nil; result:=nil;
@ -823,7 +853,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.54 2003-06-08 18:27:15 jonas Revision 1.55 2003-06-09 12:20:47 peter
* getposition added to retrieve the the current tai item
Revision 1.54 2003/06/08 18:27:15 jonas
+ ability to change the location of a ttempref node with changelocation() + ability to change the location of a ttempref node with changelocation()
method. Useful to use instead of copying the contents from one temp to method. Useful to use instead of copying the contents from one temp to
another another

View File

@ -135,6 +135,12 @@ interface
begin begin
location_reset(location,LOC_VOID,OS_NO); location_reset(location,LOC_VOID,OS_NO);
if getposition then
begin
currenttai:=tai(exprasmlist.last);
exit;
end;
if inlining_procedure then if inlining_procedure then
begin begin
objectlibrary.CreateUsedAsmSymbolList; objectlibrary.CreateUsedAsmSymbolList;
@ -310,7 +316,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.34 2003-05-17 13:30:08 jonas Revision 1.35 2003-06-09 12:20:47 peter
* getposition added to retrieve the the current tai item
Revision 1.34 2003/05/17 13:30:08 jonas
* changed tt_persistant to tt_persistent :) * changed tt_persistant to tt_persistent :)
* tempcreatenode now doesn't accept a boolean anymore for persistent * tempcreatenode now doesn't accept a boolean anymore for persistent
temps, but a ttemptype, so you can also create ansistring temps etc temps, but a ttemptype, so you can also create ansistring temps etc