mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-01 07:49:35 +01:00
* synchronised with trunk till r40724
git-svn-id: branches/debug_eh@40737 -
This commit is contained in:
commit
14cc517f40
@ -441,6 +441,9 @@ implementation
|
||||
callparas:=tfplist.Create;
|
||||
for i:=0 to high(paras) do
|
||||
begin
|
||||
{ skip parameters without data }
|
||||
if paras[i]^.isempty then
|
||||
continue;
|
||||
paraloc:=paras[i]^.location;
|
||||
while assigned(paraloc) do
|
||||
begin
|
||||
|
||||
@ -682,9 +682,19 @@ implementation
|
||||
exit
|
||||
end;
|
||||
if withparaname then
|
||||
paraloc:=hp.paraloc[calleeside].location
|
||||
begin
|
||||
{ don't add parameters that don't take up registers or stack space;
|
||||
clang doesn't either and some LLVM backends don't support them }
|
||||
if hp.paraloc[calleeside].isempty then
|
||||
exit;
|
||||
paraloc:=hp.paraloc[calleeside].location
|
||||
end
|
||||
else
|
||||
paraloc:=hp.paraloc[callerside].location;
|
||||
begin
|
||||
if hp.paraloc[callerside].isempty then
|
||||
exit;
|
||||
paraloc:=hp.paraloc[callerside].location;
|
||||
end;
|
||||
repeat
|
||||
usedef:=paraloc^.def;
|
||||
llvmextractvalueextinfo(hp.vardef,usedef,signext);
|
||||
|
||||
@ -118,6 +118,7 @@ unit parabase;
|
||||
function add_location:pcgparalocation;
|
||||
procedure get_location(var newloc:tlocation);
|
||||
function locations_count:integer;
|
||||
function isempty: boolean; { no data, and not varargs para }
|
||||
|
||||
procedure buildderef;
|
||||
procedure deref;
|
||||
@ -161,7 +162,7 @@ implementation
|
||||
|
||||
uses
|
||||
systems,verbose,
|
||||
symsym;
|
||||
symsym,defutil;
|
||||
|
||||
|
||||
{****************************************************************************
|
||||
@ -317,6 +318,25 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function TCGPara.isempty: boolean;
|
||||
var
|
||||
hlocation: pcgparalocation;
|
||||
begin
|
||||
{ can happen if e.g. [] is passed to a cdecl varargs para }
|
||||
if not assigned(def) then
|
||||
exit(true);
|
||||
if is_array_of_const(def) then
|
||||
exit(false);
|
||||
hlocation:=location;
|
||||
while assigned(hlocation) do
|
||||
begin
|
||||
if hlocation^.Loc<>LOC_VOID then
|
||||
exit(false);
|
||||
hlocation:=hlocation^.next;
|
||||
end;
|
||||
result:=true;
|
||||
end;
|
||||
|
||||
procedure TCGPara.buildderef;
|
||||
begin
|
||||
defderef.build(def);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user