mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 09:49:08 +02:00
* create rtti label using newasmsymboldata and update binding
only when calling tai_symbol.create * tai_symbol.create_global added
This commit is contained in:
parent
8acf67d327
commit
b42efec29d
@ -189,8 +189,6 @@ interface
|
|||||||
constructor ppuload(t:taitype;ppufile:tcompilerppufile);virtual;
|
constructor ppuload(t:taitype;ppufile:tcompilerppufile);virtual;
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);virtual;
|
procedure ppuwrite(ppufile:tcompilerppufile);virtual;
|
||||||
procedure derefimpl;virtual;
|
procedure derefimpl;virtual;
|
||||||
{ helper for checking symbol redefines }
|
|
||||||
procedure checkredefinesym(sym:tasmsymbol);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ abstract assembler item with line information }
|
{ abstract assembler item with line information }
|
||||||
@ -226,6 +224,7 @@ interface
|
|||||||
sym : tasmsymbol;
|
sym : tasmsymbol;
|
||||||
size : longint;
|
size : longint;
|
||||||
constructor Create(_sym:tasmsymbol;siz:longint);
|
constructor Create(_sym:tasmsymbol;siz:longint);
|
||||||
|
constructor Create_Global(_sym:tasmsymbol;siz:longint);
|
||||||
constructor Createname(const _name : string;siz:longint);
|
constructor Createname(const _name : string;siz:longint);
|
||||||
constructor Createname_global(const _name : string;siz:longint);
|
constructor Createname_global(const _name : string;siz:longint);
|
||||||
constructor Createdataname(const _name : string;siz:longint);
|
constructor Createdataname(const _name : string;siz:longint);
|
||||||
@ -569,18 +568,6 @@ uses
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tai.checkredefinesym(sym:tasmsymbol);
|
|
||||||
begin
|
|
||||||
{ if assigned(sym.taiowner) and
|
|
||||||
(target_asm.id in binassem) then
|
|
||||||
begin
|
|
||||||
Message1(asmw_e_redefined_label,sym.name);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
sym.taiowner:=self;}
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
TAILINEINFO
|
TAILINEINFO
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
@ -642,7 +629,6 @@ uses
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
typ:=ait_datablock;
|
typ:=ait_datablock;
|
||||||
sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_DATA);
|
sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_DATA);
|
||||||
{ checkredefinesym(sym);}
|
|
||||||
{ keep things aligned }
|
{ keep things aligned }
|
||||||
if _size<=0 then
|
if _size<=0 then
|
||||||
_size:=4;
|
_size:=4;
|
||||||
@ -656,7 +642,6 @@ uses
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
typ:=ait_datablock;
|
typ:=ait_datablock;
|
||||||
sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_DATA);
|
sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_DATA);
|
||||||
{ checkredefinesym(sym);}
|
|
||||||
{ keep things aligned }
|
{ keep things aligned }
|
||||||
if _size<=0 then
|
if _size<=0 then
|
||||||
_size:=4;
|
_size:=4;
|
||||||
@ -698,9 +683,19 @@ uses
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
typ:=ait_symbol;
|
typ:=ait_symbol;
|
||||||
sym:=_sym;
|
sym:=_sym;
|
||||||
{ checkredefinesym(sym);}
|
|
||||||
size:=siz;
|
size:=siz;
|
||||||
is_global:=(sym.defbind=AB_GLOBAL);
|
sym.defbind:=AB_LOCAL;
|
||||||
|
is_global:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor tai_symbol.Create_global(_sym:tasmsymbol;siz:longint);
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
typ:=ait_symbol;
|
||||||
|
sym:=_sym;
|
||||||
|
size:=siz;
|
||||||
|
sym.defbind:=AB_GLOBAL;
|
||||||
|
is_global:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor tai_symbol.Createname(const _name : string;siz:longint);
|
constructor tai_symbol.Createname(const _name : string;siz:longint);
|
||||||
@ -708,7 +703,6 @@ uses
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
typ:=ait_symbol;
|
typ:=ait_symbol;
|
||||||
sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_FUNCTION);
|
sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_FUNCTION);
|
||||||
{ checkredefinesym(sym);}
|
|
||||||
size:=siz;
|
size:=siz;
|
||||||
is_global:=false;
|
is_global:=false;
|
||||||
end;
|
end;
|
||||||
@ -718,7 +712,6 @@ uses
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
typ:=ait_symbol;
|
typ:=ait_symbol;
|
||||||
sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_FUNCTION);
|
sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_FUNCTION);
|
||||||
{ checkredefinesym(sym);}
|
|
||||||
size:=siz;
|
size:=siz;
|
||||||
is_global:=true;
|
is_global:=true;
|
||||||
end;
|
end;
|
||||||
@ -728,7 +721,6 @@ uses
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
typ:=ait_symbol;
|
typ:=ait_symbol;
|
||||||
sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_DATA);
|
sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_DATA);
|
||||||
{ checkredefinesym(sym);}
|
|
||||||
size:=siz;
|
size:=siz;
|
||||||
is_global:=false;
|
is_global:=false;
|
||||||
end;
|
end;
|
||||||
@ -738,7 +730,6 @@ uses
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
typ:=ait_symbol;
|
typ:=ait_symbol;
|
||||||
sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_DATA);
|
sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_DATA);
|
||||||
{ checkredefinesym(sym);}
|
|
||||||
size:=siz;
|
size:=siz;
|
||||||
is_global:=true;
|
is_global:=true;
|
||||||
end;
|
end;
|
||||||
@ -1142,7 +1133,6 @@ uses
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
typ:=ait_label;
|
typ:=ait_label;
|
||||||
l:=_l;
|
l:=_l;
|
||||||
{ checkredefinesym(l);}
|
|
||||||
l.is_set:=true;
|
l.is_set:=true;
|
||||||
is_global:=(l.defbind=AB_GLOBAL);
|
is_global:=(l.defbind=AB_GLOBAL);
|
||||||
end;
|
end;
|
||||||
@ -1826,7 +1816,12 @@ uses
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.27 2003-04-25 20:59:33 peter
|
Revision 1.28 2003-05-12 18:13:57 peter
|
||||||
|
* create rtti label using newasmsymboldata and update binding
|
||||||
|
only when calling tai_symbol.create
|
||||||
|
* tai_symbol.create_global added
|
||||||
|
|
||||||
|
Revision 1.27 2003/04/25 20:59:33 peter
|
||||||
* removed funcretn,funcretsym, function result is now in varsym
|
* removed funcretn,funcretsym, function result is now in varsym
|
||||||
and aliases for result and function name are added using absolutesym
|
and aliases for result and function name are added using absolutesym
|
||||||
* vs_hidden parameter for funcret passed in parameter
|
* vs_hidden parameter for funcret passed in parameter
|
||||||
|
@ -2476,7 +2476,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
{ the label is always a global label }
|
{ the label is always a global label }
|
||||||
if not assigned(lab) then
|
if not assigned(lab) then
|
||||||
lab:=objectlibrary.newasmsymboltype(mangledname,AB_GLOBAL,AT_DATA);
|
lab:=objectlibrary.newasmsymboldata(mangledname);
|
||||||
get_label:=lab;
|
get_label:=lab;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2508,7 +2508,7 @@ implementation
|
|||||||
if (cs_create_smart in aktmoduleswitches) then
|
if (cs_create_smart in aktmoduleswitches) then
|
||||||
rttiList.concat(Tai_cut.Create);
|
rttiList.concat(Tai_cut.Create);
|
||||||
rttilist.concat(tai_align.create(const_align(pointer_size)));
|
rttilist.concat(tai_align.create(const_align(pointer_size)));
|
||||||
rttiList.concat(Tai_symbol.Create(rsym.get_label,0));
|
rttiList.concat(Tai_symbol.Create_global(rsym.get_label,0));
|
||||||
def.write_rtti_data(fullrtti);
|
def.write_rtti_data(fullrtti);
|
||||||
rttiList.concat(Tai_symbol_end.Create(rsym.get_label));
|
rttiList.concat(Tai_symbol_end.Create(rsym.get_label));
|
||||||
end;
|
end;
|
||||||
@ -2547,7 +2547,7 @@ implementation
|
|||||||
if (cs_create_smart in aktmoduleswitches) then
|
if (cs_create_smart in aktmoduleswitches) then
|
||||||
rttiList.concat(Tai_cut.Create);
|
rttiList.concat(Tai_cut.Create);
|
||||||
rttilist.concat(tai_align.create(const_align(pointer_size)));
|
rttilist.concat(tai_align.create(const_align(pointer_size)));
|
||||||
rttiList.concat(Tai_symbol.Create(rsym.get_label,0));
|
rttiList.concat(Tai_symbol.Create_global(rsym.get_label,0));
|
||||||
def.write_rtti_data(initrtti);
|
def.write_rtti_data(initrtti);
|
||||||
rttiList.concat(Tai_symbol_end.Create(rsym.get_label));
|
rttiList.concat(Tai_symbol_end.Create(rsym.get_label));
|
||||||
end;
|
end;
|
||||||
@ -2558,7 +2558,12 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.102 2003-05-09 17:47:03 peter
|
Revision 1.103 2003-05-12 18:13:57 peter
|
||||||
|
* create rtti label using newasmsymboldata and update binding
|
||||||
|
only when calling tai_symbol.create
|
||||||
|
* tai_symbol.create_global added
|
||||||
|
|
||||||
|
Revision 1.102 2003/05/09 17:47:03 peter
|
||||||
* self moved to hidden parameter
|
* self moved to hidden parameter
|
||||||
* removed hdisposen,hnewn,selfn
|
* removed hdisposen,hnewn,selfn
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user