mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 00:29:48 +02:00
LLVM: fix missing line debug info for some invokes in specialised functions
Required when the code can be inlined. Fixes compilation with debug info of system.messaging.pp
This commit is contained in:
parent
9a1083c98e
commit
8147185907
@ -2937,18 +2937,23 @@ implementation
|
||||
functionscope.addint64('scopeLine',tailineinfo(hp).fileinfo.line);
|
||||
firstline:=false;
|
||||
end;
|
||||
|
||||
positionmeta:=filepos_getmetanode(tailineinfo(hp).fileinfo,procdeffileinfo,functionscope,nolineinfolevel<>0);
|
||||
end
|
||||
end;
|
||||
|
||||
{ LLVM requires line info for call instructions that may
|
||||
potentially be inlined }
|
||||
else if taillvm(hp).llvmopcode in [la_call,la_invoke] then
|
||||
if (taillvm(hp).llvmopcode in [la_call,la_invoke]) and
|
||||
not assigned(positionmeta) then
|
||||
begin
|
||||
positionmeta:=filepos_getmetanode(tailineinfo(hp).fileinfo,procdeffileinfo,functionscope,true);
|
||||
positionmeta:=filepos_getmetanode(procdeffileinfo,procdeffileinfo,functionscope,true);
|
||||
end;
|
||||
|
||||
if assigned(positionmeta) then
|
||||
taillvm(hp).addinsmetadata(tai_llvmmetadatareferenceoperand.createreferenceto('dbg',positionmeta));
|
||||
|
||||
if (cs_debuginfo in current_settings.moduleswitches) and
|
||||
(taillvm(hp).llvmopcode=la_call) then
|
||||
(taillvm(hp).llvmopcode = la_call) then
|
||||
updatelocalvardbginfo(taillvm(hp),pd,functionscope);
|
||||
end;
|
||||
hp:=tai(hp.next);
|
||||
|
Loading…
Reference in New Issue
Block a user