* override ttempinfoaccessor.settempinfoflags() for llvm and filter out

ti_may_be_in_reg flag (see comments)

git-svn-id: trunk@34359 -
This commit is contained in:
Jonas Maebe 2016-08-21 14:23:13 +00:00
parent 179c1ab328
commit 4eea5d9651

View File

@ -29,6 +29,11 @@ interface
nbas,ncgbas;
type
tllvmtempinfoaccessor = class(ttempinfoaccessor)
protected
class procedure settempinfoflags(tempinfo: ptempinfo; const flags: ttempinfoflags); override;
end;
tllvmtempcreatenode = class(tcgtempcreatenode)
procedure pass_generate_code;override;
end;
@ -41,6 +46,23 @@ interface
llvmbase,aasmllvm
;
{*****************************************************************************
TLLVMTEMPINFOACCESSOR
*****************************************************************************}
class procedure tllvmtempinfoaccessor.settempinfoflags(tempinfo: ptempinfo; const flags: ttempinfoflags);
begin
{ it is not possible to typecast between e.g. an integer and a record
in a register, which is a problem if such a typecast is performed on
an lvalue (since we then have to store it first to a temp in memory,
which means we no longer have an lvalue).
Disable regvars altogether since LLVM will put the values in registers
anyway if possible/useful. }
inherited settempinfoflags(tempinfo,flags-[ti_may_be_in_reg]);
end;
{*****************************************************************************
TTEMPCREATENODE
*****************************************************************************}
@ -63,5 +85,6 @@ interface
begin
ctempinfoaccessor:=tllvmtempinfoaccessor;
ctempcreatenode:=tllvmtempcreatenode;
end.