* converted taillvmdecl properties to a set

git-svn-id: trunk@31653 -
This commit is contained in:
Jonas Maebe 2015-09-12 23:33:42 +00:00
parent 4b92083006
commit 7a08319d2e
2 changed files with 13 additions and 7 deletions

View File

@ -147,6 +147,13 @@ interface
constructor create(_oldsym: tasmsymbol; const newname: TSymStr; _def: tdef; _vis: tllvmvisibility; _linkage: tllvmlinkage);
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
here and external }
taillvmdecl = class(tai)
@ -156,8 +163,7 @@ interface
def: tdef;
sec: TAsmSectiontype;
alignment: shortint;
definition: boolean;
tls: boolean;
flags: taillvmdeclflags;
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 createtls(_namesym: tasmsymbol; _def: tdef; _alignment: shortint);
@ -196,21 +202,21 @@ uses
sec:=_sec;
alignment:=_alignment;
_namesym.declared:=true;
definition:=false;
flags:=[];
end;
constructor taillvmdecl.createdef(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
begin
createdecl(_namesym,_def,_initdata,_sec,_alignment);
definition:=true;
include(flags,ldf_definition);
end;
constructor taillvmdecl.createtls(_namesym: tasmsymbol; _def: tdef; _alignment: shortint);
begin
createdef(_namesym,_def,nil,sec_data,_alignment);
tls:=true;
include(flags,ldf_tls);
end;

View File

@ -915,7 +915,7 @@ implementation
begin
if taillvmdecl(hp).def.typ=procdef then
begin
if not taillvmdecl(hp).definition then
if not(ldf_definition in taillvmdecl(hp).flags) then
begin
writer.AsmWrite('declare');
writer.AsmWriteln(llvmencodeproctype(tprocdef(taillvmdecl(hp).def), taillvmdecl(hp).namesym.name, lpd_decl));
@ -946,7 +946,7 @@ implementation
else
internalerror(2014020104);
end;
if taillvmdecl(hp).tls then
if (ldf_tls in taillvmdecl(hp).flags) then
writer.AsmWrite('thread_local ');
{ todo: handle more different section types (mainly
Objective-C }