* ensure that the lineinfo of temps corresponds to the lineinfo of the

procedure entry code

git-svn-id: branches/hlcgllvm@26980 -
This commit is contained in:
Jonas Maebe 2014-03-06 21:40:15 +00:00
parent c095a1b06a
commit 839ad45b9e

View File

@ -86,6 +86,7 @@ implementation
procedure ttgllvm.alloctemp(list: TAsmList; size, alignment: longint; temptype: ttemptype; def: tdef; out ref: treference);
var
tl: ptemprecord;
oldfileinfo: tfileposinfo;
begin
reference_reset_base(ref,cg.gettempregister(list),0,alignment);
new(tl);
@ -101,8 +102,16 @@ implementation
{ TODO: add llvm.lifetime.start() for this allocation and afterwards
llvm.lifetime.end() for freetemp (if the llvm version supports it) }
inc(lasttemp);
{ allocation for the temp }
{ allocation for the temp -- should have lineinfo of the start of the
routine }
if assigned(current_procinfo) then
begin
oldfileinfo:=current_filepos;
current_filepos:=current_procinfo.procdef.fileinfo;
end;
alloclist.concat(taillvm.op_ref_size(la_alloca,ref,def));
if assigned(current_procinfo) then
current_filepos:=oldfileinfo;
end;