mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:09:19 +02:00
* external used before implemented problem fixed
This commit is contained in:
parent
f8395f4a48
commit
f2eb2dc540
@ -319,6 +319,7 @@ type
|
|||||||
asmsymbollist : pasmsymbollist;
|
asmsymbollist : pasmsymbollist;
|
||||||
|
|
||||||
function newasmsymbol(const s : string) : pasmsymbol;
|
function newasmsymbol(const s : string) : pasmsymbol;
|
||||||
|
function renameasmsymbol(const sold, snew : string) : pasmsymbol;
|
||||||
|
|
||||||
{ label functions }
|
{ label functions }
|
||||||
const
|
const
|
||||||
@ -824,6 +825,38 @@ uses
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ renames an asmsymbol }
|
||||||
|
function renameasmsymbol(const sold, snew : string) : pasmsymbol;
|
||||||
|
var
|
||||||
|
hpold,hpnew : pasmsymbol;
|
||||||
|
begin
|
||||||
|
hpnew:=pasmsymbol(asmsymbollist^.search(snew));
|
||||||
|
if assigned(hpnew) then
|
||||||
|
internalerror(405405);
|
||||||
|
hpold:=pasmsymbol(asmsymbollist^.search(sold));
|
||||||
|
if not assigned(hpold) then
|
||||||
|
internalerror(405406);
|
||||||
|
|
||||||
|
hpnew:=new(pasmsymbol,init(sold));
|
||||||
|
{ replace the old one }
|
||||||
|
{ WARNING this heavily depends on the
|
||||||
|
feature that tdictionnary.insert does not delete
|
||||||
|
the tree element that it replaces !! }
|
||||||
|
asmsymbollist^.replace_existing:=true;
|
||||||
|
asmsymbollist^.insert(hpnew);
|
||||||
|
asmsymbollist^.replace_existing:=false;
|
||||||
|
{ restore the tree }
|
||||||
|
hpnew^.left:=hpold^.left;
|
||||||
|
hpnew^.right:=hpold^.right;
|
||||||
|
stringdispose(hpold^._name);
|
||||||
|
hpold^._name:=stringdup(snew);
|
||||||
|
hpold^.speedvalue:=getspeedvalue(snew);
|
||||||
|
{ now reinsert it at right location !! }
|
||||||
|
asmsymbollist^.insert(hpold);
|
||||||
|
renameasmsymbol:=hpold;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
Label Helpers
|
Label Helpers
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
@ -937,7 +970,10 @@ uses
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.31 1999-02-25 21:02:16 peter
|
Revision 1.32 1999-03-01 13:31:59 pierre
|
||||||
|
* external used before implemented problem fixed
|
||||||
|
|
||||||
|
Revision 1.31 1999/02/25 21:02:16 peter
|
||||||
* ag386bin updates
|
* ag386bin updates
|
||||||
+ coff writer
|
+ coff writer
|
||||||
|
|
||||||
|
@ -163,6 +163,7 @@ unit cobjects;
|
|||||||
Tdictionary=object
|
Tdictionary=object
|
||||||
root:Pnamed_object;
|
root:Pnamed_object;
|
||||||
hasharray:Pdictionaryhasharray;
|
hasharray:Pdictionaryhasharray;
|
||||||
|
replace_existing : boolean;
|
||||||
constructor init(usehash:boolean);
|
constructor init(usehash:boolean);
|
||||||
procedure clear;virtual;
|
procedure clear;virtual;
|
||||||
procedure foreach(proc2call:Tcallback);
|
procedure foreach(proc2call:Tcallback);
|
||||||
@ -859,6 +860,7 @@ constructor Tdictionary.init(usehash:boolean);
|
|||||||
begin
|
begin
|
||||||
root:=nil;
|
root:=nil;
|
||||||
hasharray:=nil;
|
hasharray:=nil;
|
||||||
|
replace_existing:=false;
|
||||||
if usehash then
|
if usehash then
|
||||||
begin
|
begin
|
||||||
new(hasharray);
|
new(hasharray);
|
||||||
@ -962,6 +964,15 @@ function Tdictionary.insert(obj:Pnamed_object):Pnamed_object;
|
|||||||
begin
|
begin
|
||||||
dispose(s2);
|
dispose(s2);
|
||||||
dispose(s1);
|
dispose(s1);
|
||||||
|
if replace_existing and
|
||||||
|
assigned(osym) then
|
||||||
|
begin
|
||||||
|
obj^.left:=osym^.left;
|
||||||
|
obj^.right:=osym^.right;
|
||||||
|
osym:=obj;
|
||||||
|
_insert:=obj;
|
||||||
|
end
|
||||||
|
else
|
||||||
_insert:=osym;
|
_insert:=osym;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1413,7 +1424,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.18 1999-02-24 00:59:13 peter
|
Revision 1.19 1999-03-01 13:32:00 pierre
|
||||||
|
* external used before implemented problem fixed
|
||||||
|
|
||||||
|
Revision 1.18 1999/02/24 00:59:13 peter
|
||||||
* small updates for ag386bin
|
* small updates for ag386bin
|
||||||
|
|
||||||
Revision 1.17 1999/01/19 11:00:33 daniel
|
Revision 1.17 1999/01/19 11:00:33 daniel
|
||||||
|
Loading…
Reference in New Issue
Block a user