mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-04 04:37:19 +01:00
* record the alignment in taillvmdecl, as it can be different from the
default git-svn-id: branches/hlcgllvm@28752 -
This commit is contained in:
parent
37009c917b
commit
6677e698cd
@ -152,9 +152,10 @@ interface
|
||||
namesym: tasmsymbol;
|
||||
def: tdef;
|
||||
sec: TAsmSectiontype;
|
||||
alignment: shortint;
|
||||
tls: boolean;
|
||||
constructor create(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype);
|
||||
constructor createtls(_namesym: tasmsymbol; _def: tdef);
|
||||
constructor create(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
||||
constructor createtls(_namesym: tasmsymbol; _def: tdef; _alignment: shortint);
|
||||
destructor destroy; override;
|
||||
end;
|
||||
|
||||
@ -180,7 +181,7 @@ uses
|
||||
|
||||
{ taillvmprocdecl }
|
||||
|
||||
constructor taillvmdecl.create(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype);
|
||||
constructor taillvmdecl.create(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
||||
begin
|
||||
inherited create;
|
||||
typ:=ait_llvmdecl;
|
||||
@ -188,13 +189,14 @@ uses
|
||||
def:=_def;
|
||||
initdata:=_initdata;
|
||||
sec:=_sec;
|
||||
alignment:=_alignment;
|
||||
_namesym.declared:=true;
|
||||
end;
|
||||
|
||||
|
||||
constructor taillvmdecl.createtls(_namesym: tasmsymbol; _def: tdef);
|
||||
constructor taillvmdecl.createtls(_namesym: tasmsymbol; _def: tdef; _alignment: shortint);
|
||||
begin
|
||||
create(_namesym,_def,nil,sec_data);
|
||||
create(_namesym,_def,nil,sec_data,_alignment);
|
||||
tls:=true;
|
||||
end;
|
||||
|
||||
@ -238,7 +240,7 @@ uses
|
||||
internalerror(2014020701);
|
||||
def:=tpointerdef(def).pointeddef;
|
||||
end;
|
||||
current_asmdata.AsmLists[al_imports].concat(taillvmdecl.create(ref.symbol,def,nil,sec_none));
|
||||
current_asmdata.AsmLists[al_imports].concat(taillvmdecl.create(ref.symbol,def,nil,sec_none,def.alignment));
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -918,7 +918,7 @@ implementation
|
||||
end;
|
||||
{ alignment }
|
||||
asmwrite(', align ');
|
||||
asmwriteln(tostr(taillvmdecl(hp).def.alignment));
|
||||
asmwriteln(tostr(taillvmdecl(hp).alignment));
|
||||
end;
|
||||
end;
|
||||
ait_llvmalias:
|
||||
|
||||
@ -434,7 +434,7 @@ implementation
|
||||
begin
|
||||
asmsym:=current_asmdata.RefAsmSymbol(tprocdef(pd).mangledname);
|
||||
if not asmsym.declared then
|
||||
current_asmdata.AsmLists[al_imports].Concat(taillvmdecl.create(asmsym, pd, nil, sec_code));
|
||||
current_asmdata.AsmLists[al_imports].Concat(taillvmdecl.create(asmsym,pd,nil,sec_code,pd.alignment));
|
||||
end;
|
||||
a_call_common(list,pd,paras,forceresdef,res,calldef,hlretdef,llvmretdef,callparas);
|
||||
list.concat(taillvm.call_size_name_paras(res,calldef,current_asmdata.RefAsmSymbol(pd.mangledname),callparas));
|
||||
@ -1016,7 +1016,7 @@ implementation
|
||||
list.concat(taillvmalias.create(asmsym,item.str,current_procinfo.procdef,llv_default,lll_default));
|
||||
item:=TCmdStrListItem(item.next);
|
||||
end;
|
||||
list.concat(taillvmdecl.create(asmsym,current_procinfo.procdef,nil,sec_code));
|
||||
list.concat(taillvmdecl.create(asmsym,current_procinfo.procdef,nil,sec_code,current_procinfo.procdef.alignment));
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ implementation
|
||||
newasmlist:=tasmlist.create_without_marker;
|
||||
{ llvm declaration with as initialisation data all the elements from the
|
||||
original asmlist }
|
||||
newasmlist.concat(taillvmdecl.create(sym,def,fasmlist,section));
|
||||
newasmlist.concat(taillvmdecl.create(sym,def,fasmlist,section,alignment));
|
||||
fasmlist:=newasmlist;
|
||||
end;
|
||||
|
||||
|
||||
@ -61,9 +61,9 @@ implementation
|
||||
else
|
||||
asmsym:=current_asmdata.DefineAsmSymbol(sym.mangledname,AB_LOCAL,AT_DATA);
|
||||
if not(vo_is_thread_var in sym.varoptions) then
|
||||
list.concat(taillvmdecl.create(asmsym,sym.vardef,nil,sec_data))
|
||||
list.concat(taillvmdecl.create(asmsym,sym.vardef,nil,sec_data,varalign))
|
||||
else
|
||||
list.concat(taillvmdecl.createtls(asmsym,sym.vardef))
|
||||
list.concat(taillvmdecl.createtls(asmsym,sym.vardef,varalign))
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user