mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 03:39:33 +02:00
* changed ncgutil.has_alias_name(pd,s) to a method of tprocdef
git-svn-id: trunk@35085 -
This commit is contained in:
parent
4406ec7e68
commit
472b5228fe
@ -155,7 +155,7 @@ begin
|
|||||||
for i:=0 to tprocsym(hp2.sym).procdeflist.count-1 do
|
for i:=0 to tprocsym(hp2.sym).procdeflist.count-1 do
|
||||||
begin
|
begin
|
||||||
pd:=tprocdef(tprocsym(hp2.sym).procdeflist[i]);
|
pd:=tprocdef(tprocsym(hp2.sym).procdeflist[i]);
|
||||||
anyhasalias:=has_alias_name(pd,hp2.name^);
|
anyhasalias:=pd.has_alias_name(hp2.name^);
|
||||||
if anyhasalias then
|
if anyhasalias then
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
|
@ -74,7 +74,6 @@ interface
|
|||||||
procedure register_maybe_adjust_setbase(list: TAsmList; opdef: tdef; var l: tlocation; setbase: aint);
|
procedure register_maybe_adjust_setbase(list: TAsmList; opdef: tdef; var l: tlocation; setbase: aint);
|
||||||
|
|
||||||
|
|
||||||
function has_alias_name(pd:tprocdef;const s:string):boolean;
|
|
||||||
procedure alloc_proc_symbol(pd: tprocdef);
|
procedure alloc_proc_symbol(pd: tprocdef);
|
||||||
procedure release_proc_symbol(pd:tprocdef);
|
procedure release_proc_symbol(pd:tprocdef);
|
||||||
procedure gen_proc_entry_code(list:TAsmList);
|
procedure gen_proc_entry_code(list:TAsmList);
|
||||||
@ -1350,24 +1349,6 @@ implementation
|
|||||||
Entry/Exit
|
Entry/Exit
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
function has_alias_name(pd:tprocdef;const s:string):boolean;
|
|
||||||
var
|
|
||||||
item : TCmdStrListItem;
|
|
||||||
begin
|
|
||||||
result:=true;
|
|
||||||
if pd.mangledname=s then
|
|
||||||
exit;
|
|
||||||
item := TCmdStrListItem(pd.aliasnames.first);
|
|
||||||
while assigned(item) do
|
|
||||||
begin
|
|
||||||
if item.str=s then
|
|
||||||
exit;
|
|
||||||
item := TCmdStrListItem(item.next);
|
|
||||||
end;
|
|
||||||
result:=false;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure alloc_proc_symbol(pd: tprocdef);
|
procedure alloc_proc_symbol(pd: tprocdef);
|
||||||
var
|
var
|
||||||
item : TCmdStrListItem;
|
item : TCmdStrListItem;
|
||||||
|
@ -936,12 +936,12 @@ implementation
|
|||||||
for j:=0 to tprocsym(sym).procdeflist.count-1 do
|
for j:=0 to tprocsym(sym).procdeflist.count-1 do
|
||||||
begin
|
begin
|
||||||
pd:=tprocdef(tprocsym(sym).procdeflist[j]);
|
pd:=tprocdef(tprocsym(sym).procdeflist[j]);
|
||||||
if (nameinit<>'') and not foundinit and has_alias_name(pd,nameinit) then
|
if (nameinit<>'') and not foundinit and pd.has_alias_name(nameinit) then
|
||||||
begin
|
begin
|
||||||
current_module.addimportedsym(sym);
|
current_module.addimportedsym(sym);
|
||||||
foundinit:=true;
|
foundinit:=true;
|
||||||
end;
|
end;
|
||||||
if (namefini<>'') and not foundfini and has_alias_name(pd,namefini) then
|
if (namefini<>'') and not foundfini and pd.has_alias_name(namefini) then
|
||||||
begin
|
begin
|
||||||
current_module.addimportedsym(sym);
|
current_module.addimportedsym(sym);
|
||||||
foundfini:=true;
|
foundfini:=true;
|
||||||
|
@ -675,7 +675,7 @@ implementation
|
|||||||
for k:=0 to tprocsym(psym).procdeflist.count-1 do
|
for k:=0 to tprocsym(psym).procdeflist.count-1 do
|
||||||
begin
|
begin
|
||||||
pd:=tprocdef(tprocsym(psym).procdeflist[k]);
|
pd:=tprocdef(tprocsym(psym).procdeflist[k]);
|
||||||
if has_alias_name(pd,symname) or
|
if pd.has_alias_name(symname) or
|
||||||
(
|
(
|
||||||
([po_external,po_has_importdll]*pd.procoptions=[po_external,po_has_importdll]) and
|
([po_external,po_has_importdll]*pd.procoptions=[po_external,po_has_importdll]) and
|
||||||
(symname=proc_get_importname(pd))
|
(symname=proc_get_importname(pd))
|
||||||
|
@ -819,6 +819,10 @@ interface
|
|||||||
procedure make_external;
|
procedure make_external;
|
||||||
procedure init_genericdecl;
|
procedure init_genericdecl;
|
||||||
|
|
||||||
|
{ returns whether the mangled name or any of its aliases is equal to
|
||||||
|
s }
|
||||||
|
function has_alias_name(const s: TSymStr):boolean;
|
||||||
|
|
||||||
{ aliases to fields only required when a function is implemented in
|
{ aliases to fields only required when a function is implemented in
|
||||||
the current unit }
|
the current unit }
|
||||||
property resultname: PShortString read GetResultName write SetResultName;
|
property resultname: PShortString read GetResultName write SetResultName;
|
||||||
@ -5865,6 +5869,24 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tprocdef.has_alias_name(const s: TSymStr): boolean;
|
||||||
|
var
|
||||||
|
item : TCmdStrListItem;
|
||||||
|
begin
|
||||||
|
result:=true;
|
||||||
|
if mangledname=s then
|
||||||
|
exit;
|
||||||
|
item:=TCmdStrListItem(aliasnames.first);
|
||||||
|
while assigned(item) do
|
||||||
|
begin
|
||||||
|
if item.str=s then
|
||||||
|
exit;
|
||||||
|
item:=TCmdStrListItem(item.next);
|
||||||
|
end;
|
||||||
|
result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tprocdef.GetSymtable(t:tGetSymtable):TSymtable;
|
function tprocdef.GetSymtable(t:tGetSymtable):TSymtable;
|
||||||
begin
|
begin
|
||||||
case t of
|
case t of
|
||||||
|
Loading…
Reference in New Issue
Block a user