mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 17:46:05 +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;
|
destructor destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tllvmcallparaflag = (lcp_byval, lcp_sret);
|
tllvmcallparaflag = (lcp_byval, lcp_sret, lcp_metadata);
|
||||||
tllvmcallparaflags = set of tllvmcallparaflag;
|
tllvmcallparaflags = set of tllvmcallparaflag;
|
||||||
|
|
||||||
tllvmcallparaval = record
|
tllvmcallparaval = record
|
||||||
|
@ -347,6 +347,11 @@ implementation
|
|||||||
if i<>0 then
|
if i<>0 then
|
||||||
owner.writer.AsmWrite(', ');
|
owner.writer.AsmWrite(', ');
|
||||||
para:=pllvmcallpara(paras[i]);
|
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));
|
owner.writer.AsmWrite(llvmencodetypename(para^.def));
|
||||||
if para^.valueext<>lve_none then
|
if para^.valueext<>lve_none then
|
||||||
owner.writer.AsmWrite(llvmvalueextension2str[para^.valueext]);
|
owner.writer.AsmWrite(llvmvalueextension2str[para^.valueext]);
|
||||||
|
@ -476,6 +476,8 @@ implementation
|
|||||||
while assigned(paraloc) do
|
while assigned(paraloc) do
|
||||||
begin
|
begin
|
||||||
new(callpara,init(paraloc^.def,std_param_align,lve_none,[]));
|
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;
|
callpara^.def:=paraloc^.def;
|
||||||
{ if the paraloc doesn't contain the value itself, it's a byval
|
{ if the paraloc doesn't contain the value itself, it's a byval
|
||||||
parameter }
|
parameter }
|
||||||
|
Loading…
Reference in New Issue
Block a user