mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 18:49:16 +02:00
* converted taillvmdecl properties to a set
git-svn-id: trunk@31653 -
This commit is contained in:
parent
4b92083006
commit
7a08319d2e
@ -147,6 +147,13 @@ interface
|
|||||||
constructor create(_oldsym: tasmsymbol; const newname: TSymStr; _def: tdef; _vis: tllvmvisibility; _linkage: tllvmlinkage);
|
constructor create(_oldsym: tasmsymbol; const newname: TSymStr; _def: tdef; _vis: tllvmvisibility; _linkage: tllvmlinkage);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
taillvmdeclflag =
|
||||||
|
(
|
||||||
|
ldf_definition, { definition as opposed to (an external) declaration }
|
||||||
|
ldf_tls { tls definition }
|
||||||
|
);
|
||||||
|
taillvmdeclflags = set of taillvmdeclflag;
|
||||||
|
|
||||||
{ declarations/definitions of symbols (procedures, variables), both defined
|
{ declarations/definitions of symbols (procedures, variables), both defined
|
||||||
here and external }
|
here and external }
|
||||||
taillvmdecl = class(tai)
|
taillvmdecl = class(tai)
|
||||||
@ -156,8 +163,7 @@ interface
|
|||||||
def: tdef;
|
def: tdef;
|
||||||
sec: TAsmSectiontype;
|
sec: TAsmSectiontype;
|
||||||
alignment: shortint;
|
alignment: shortint;
|
||||||
definition: boolean;
|
flags: taillvmdeclflags;
|
||||||
tls: boolean;
|
|
||||||
constructor createdecl(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
constructor createdecl(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
||||||
constructor createdef(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
constructor createdef(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
||||||
constructor createtls(_namesym: tasmsymbol; _def: tdef; _alignment: shortint);
|
constructor createtls(_namesym: tasmsymbol; _def: tdef; _alignment: shortint);
|
||||||
@ -196,21 +202,21 @@ uses
|
|||||||
sec:=_sec;
|
sec:=_sec;
|
||||||
alignment:=_alignment;
|
alignment:=_alignment;
|
||||||
_namesym.declared:=true;
|
_namesym.declared:=true;
|
||||||
definition:=false;
|
flags:=[];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
constructor taillvmdecl.createdef(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
constructor taillvmdecl.createdef(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
||||||
begin
|
begin
|
||||||
createdecl(_namesym,_def,_initdata,_sec,_alignment);
|
createdecl(_namesym,_def,_initdata,_sec,_alignment);
|
||||||
definition:=true;
|
include(flags,ldf_definition);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
constructor taillvmdecl.createtls(_namesym: tasmsymbol; _def: tdef; _alignment: shortint);
|
constructor taillvmdecl.createtls(_namesym: tasmsymbol; _def: tdef; _alignment: shortint);
|
||||||
begin
|
begin
|
||||||
createdef(_namesym,_def,nil,sec_data,_alignment);
|
createdef(_namesym,_def,nil,sec_data,_alignment);
|
||||||
tls:=true;
|
include(flags,ldf_tls);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -915,7 +915,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if taillvmdecl(hp).def.typ=procdef then
|
if taillvmdecl(hp).def.typ=procdef then
|
||||||
begin
|
begin
|
||||||
if not taillvmdecl(hp).definition then
|
if not(ldf_definition in taillvmdecl(hp).flags) then
|
||||||
begin
|
begin
|
||||||
writer.AsmWrite('declare');
|
writer.AsmWrite('declare');
|
||||||
writer.AsmWriteln(llvmencodeproctype(tprocdef(taillvmdecl(hp).def), taillvmdecl(hp).namesym.name, lpd_decl));
|
writer.AsmWriteln(llvmencodeproctype(tprocdef(taillvmdecl(hp).def), taillvmdecl(hp).namesym.name, lpd_decl));
|
||||||
@ -946,7 +946,7 @@ implementation
|
|||||||
else
|
else
|
||||||
internalerror(2014020104);
|
internalerror(2014020104);
|
||||||
end;
|
end;
|
||||||
if taillvmdecl(hp).tls then
|
if (ldf_tls in taillvmdecl(hp).flags) then
|
||||||
writer.AsmWrite('thread_local ');
|
writer.AsmWrite('thread_local ');
|
||||||
{ todo: handle more different section types (mainly
|
{ todo: handle more different section types (mainly
|
||||||
Objective-C }
|
Objective-C }
|
||||||
|
Loading…
Reference in New Issue
Block a user