mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-27 10:09:26 +02:00
* 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:
parent
179c1ab328
commit
4eea5d9651
@ -29,6 +29,11 @@ interface
|
|||||||
nbas,ncgbas;
|
nbas,ncgbas;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
tllvmtempinfoaccessor = class(ttempinfoaccessor)
|
||||||
|
protected
|
||||||
|
class procedure settempinfoflags(tempinfo: ptempinfo; const flags: ttempinfoflags); override;
|
||||||
|
end;
|
||||||
|
|
||||||
tllvmtempcreatenode = class(tcgtempcreatenode)
|
tllvmtempcreatenode = class(tcgtempcreatenode)
|
||||||
procedure pass_generate_code;override;
|
procedure pass_generate_code;override;
|
||||||
end;
|
end;
|
||||||
@ -41,6 +46,23 @@ interface
|
|||||||
llvmbase,aasmllvm
|
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
|
TTEMPCREATENODE
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
@ -63,5 +85,6 @@ interface
|
|||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
ctempinfoaccessor:=tllvmtempinfoaccessor;
|
||||||
ctempcreatenode:=tllvmtempcreatenode;
|
ctempcreatenode:=tllvmtempcreatenode;
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user