Browse Source

* ensure that the lineinfo of temps corresponds to the lineinfo of the
procedure entry code

git-svn-id: branches/hlcgllvm@26980 -

Jonas Maebe 11 years ago
parent
commit
839ad45b9e
1 changed files with 10 additions and 1 deletions
  1. 10 1
      compiler/llvm/tgllvm.pas

+ 10 - 1
compiler/llvm/tgllvm.pas

@@ -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;