mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 22:47:59 +02:00
tllvmcallpara: record whether it's passed to metadata
Sometimes we need the def to store a the original def of the passed parameter, e.g. for the first argument to llvm.dbg.addr
This commit is contained in:
parent
41a6c5e967
commit
a76085e463
@ -209,7 +209,7 @@ interface
|
||||
destructor destroy; override;
|
||||
end;
|
||||
|
||||
tllvmcallparaflag = (lcp_byval, lcp_sret);
|
||||
tllvmcallparaflag = (lcp_byval, lcp_sret, lcp_metadata);
|
||||
tllvmcallparaflags = set of tllvmcallparaflag;
|
||||
|
||||
tllvmcallparaval = record
|
||||
|
@ -347,6 +347,11 @@ implementation
|
||||
if i<>0 then
|
||||
owner.writer.AsmWrite(', ');
|
||||
para:=pllvmcallpara(paras[i]);
|
||||
if (lcp_metadata in para^.flags) and
|
||||
(para^.def<>llvm_metadatatype) then
|
||||
begin
|
||||
owner.writer.AsmWrite('metadata ')
|
||||
end;
|
||||
owner.writer.AsmWrite(llvmencodetypename(para^.def));
|
||||
if para^.valueext<>lve_none then
|
||||
owner.writer.AsmWrite(llvmvalueextension2str[para^.valueext]);
|
||||
|
@ -476,6 +476,8 @@ implementation
|
||||
while assigned(paraloc) do
|
||||
begin
|
||||
new(callpara,init(paraloc^.def,std_param_align,lve_none,[]));
|
||||
if paras[i]^.def=llvm_metadatatype then
|
||||
include(callpara^.flags,lcp_metadata);
|
||||
callpara^.def:=paraloc^.def;
|
||||
{ if the paraloc doesn't contain the value itself, it's a byval
|
||||
parameter }
|
||||
|
Loading…
Reference in New Issue
Block a user