* keep track of the alignment requirements of parameters with LLVM, and emit

them when they are different from the default

git-svn-id: branches/debug_eh@41216 -
This commit is contained in:
Jonas Maebe 2019-02-03 21:10:14 +00:00
parent 016882ca82
commit af098474f4
4 changed files with 14 additions and 0 deletions

View File

@ -204,6 +204,7 @@ interface
pllvmcallpara = ^tllvmcallpara;
tllvmcallpara = record
def: tdef;
alignment: byte;
valueext: tllvmvalueextension;
byval,
sret: boolean;

View File

@ -339,6 +339,11 @@ implementation
owner.writer.AsmWrite(' byval');
if para^.sret then
owner.writer.AsmWrite(' sret');
if para^.alignment<>std_param_align then
begin
owner.writer.AsmWrite(' align ');
owner.writer.AsmWrite(tostr(para^.alignment));
end;
case para^.typ of
top_reg:
begin

View File

@ -437,6 +437,7 @@ implementation
href: treference;
callpara: pllvmcallpara;
paraloc: pcgparalocation;
firstparaloc: boolean;
begin
callparas:=tfplist.Create;
for i:=0 to high(paras) do
@ -445,10 +446,15 @@ implementation
if paras[i]^.isempty then
continue;
paraloc:=paras[i]^.location;
firstparaloc:=true;
while assigned(paraloc) do
begin
new(callpara);
callpara^.def:=paraloc^.def;
if firstparaloc then
callpara^.alignment:=paras[i]^.Alignment
else
callpara^.alignment:=std_param_align;
{ if the paraloc doesn't contain the value itself, it's a byval
parameter }
if paraloc^.retvalloc then
@ -515,6 +521,7 @@ implementation
end;
callparas.add(callpara);
paraloc:=paraloc^.next;
firstparaloc:=false;
end;
end;
{ the Pascal level may expect a different returndef compared to the

View File

@ -84,6 +84,7 @@ interface
if not assigned(res^.Data) then
begin
new(callpara);
callpara^.alignment:=std_param_align;
callpara^.def:=cpointerdef.getreusable(sym.vardef);
if (sym.typ=paravarsym) and
paramanager.push_addr_param(sym.varspez,sym.vardef,current_procinfo.procdef.proccalloption) then