* use tasmbind for llvm aliases and derive llvm flags from that

git-svn-id: trunk@33720 -
This commit is contained in:
Jonas Maebe 2016-05-20 20:51:25 +00:00
parent e15816e35b
commit 4fff9645af
3 changed files with 7 additions and 20 deletions

View File

@ -142,11 +142,10 @@ interface
);
taillvmalias = class(tailineinfo)
vis: tllvmvisibility;
linkage: tllvmlinkage;
bind: tasmsymbind;
oldsym, newsym: TAsmSymbol;
def: tdef;
constructor create(_oldsym: tasmsymbol; const newname: TSymStr; _def: tdef; _vis: tllvmvisibility; _linkage: tllvmlinkage);
constructor create(_oldsym: tasmsymbol; const newname: TSymStr; _def: tdef; _bind: tasmsymbind);
end;
taillvmdeclflag =
@ -244,7 +243,7 @@ uses
{ taillvmalias }
constructor taillvmalias.create(_oldsym: tasmsymbol; const newname: TSymStr; _def: tdef; _vis: tllvmvisibility; _linkage: tllvmlinkage);
constructor taillvmalias.create(_oldsym: tasmsymbol; const newname: TSymStr; _def: tdef; _bind: tasmsymbind);
begin
inherited Create;
typ:=ait_llvmalias;
@ -252,8 +251,7 @@ uses
newsym:=current_asmdata.DefineAsmSymbol(newname,AB_GLOBAL,AT_FUNCTION);
newsym.declared:=true;
def:=_def;
vis:=_vis;
linkage:=_linkage;
bind:=_bind;
end;

View File

@ -1047,18 +1047,7 @@ implementation
begin
writer.AsmWrite(LlvmAsmSymName(taillvmalias(hp).newsym));
writer.AsmWrite(' = alias ');
if taillvmalias(hp).linkage<>lll_default then
begin
str(taillvmalias(hp).linkage, s);
writer.AsmWrite(copy(s, length('lll_')+1, 255));
writer.AsmWrite(' ');
end;
if taillvmalias(hp).vis<>llv_default then
begin
str(taillvmalias(hp).vis, s);
writer.AsmWrite(copy(s, length('llv_')+1, 255));
writer.AsmWrite(' ');
end;
WriteLinkageVibilityFlags(taillvmalias(hp).bind);
if taillvmalias(hp).def.typ=procdef then
writer.AsmWrite(llvmencodeproctype(tabstractprocdef(taillvmalias(hp).def), '', lpd_alias))
else

View File

@ -1171,7 +1171,7 @@ implementation
while assigned(item) do
begin
if mangledname<>item.Str then
list.concat(taillvmalias.create(asmsym,item.str,current_procinfo.procdef,llv_default,lll_default));
list.concat(taillvmalias.create(asmsym,item.str,current_procinfo.procdef,asmsym.bind));
item:=TCmdStrListItem(item.next);
end;
list.concat(taillvmdecl.createdef(asmsym,current_procinfo.procdef,nil,sec_code,current_procinfo.procdef.alignment));
@ -1901,7 +1901,7 @@ implementation
if po_external in procdef.procoptions then
exit;
asmsym:=current_asmdata.RefAsmSymbol(externalname,AT_FUNCTION);
list.concat(taillvmalias.create(asmsym,procdef.mangledname,procdef,llv_default,lll_default));
list.concat(taillvmalias.create(asmsym,procdef.mangledname,procdef,asmsym.bind));
end;