+ temp_to_ref() implementation for llvm

git-svn-id: branches/hlcgllvm@28491 -
This commit is contained in:
Jonas Maebe 2014-08-19 20:22:50 +00:00
parent 0fbaa9e924
commit 33c277b3a7

View File

@ -30,7 +30,7 @@ uses
globtype,cclasses, globtype,cclasses,
aasmbase,aasmdata, aasmbase,aasmdata,
symbase,symconst,symtype,symdef,symsym, symbase,symconst,symtype,symdef,symsym,
cpubase, hlcgobj, cgbase, cgutils, parabase; cpubase, hlcgobj, cgbase, cgutils, parabase, tgobj;
type type
@ -39,6 +39,8 @@ uses
thlcgllvm = class(thlcgobj) thlcgllvm = class(thlcgobj)
constructor create; constructor create;
procedure temp_to_ref(p: ptemprecord; out ref: treference); override;
procedure a_load_ref_cgpara(list: TAsmList; size: tdef; const r: treference; const cgpara: TCGPara); override; procedure a_load_ref_cgpara(list: TAsmList; size: tdef; const r: treference; const cgpara: TCGPara); override;
protected protected
procedure a_load_ref_cgpara_init_src(list: TAsmList; const para: tcgpara; const initialref: treference; var refsize: tdef; out newref: treference); procedure a_load_ref_cgpara_init_src(list: TAsmList; const para: tcgpara; const initialref: treference; var refsize: tdef; out newref: treference);
@ -140,7 +142,7 @@ implementation
aasmllvm,llvmbase,tgllvm, aasmllvm,llvmbase,tgllvm,
symtable, symtable,
paramgr,llvmpara, paramgr,llvmpara,
procinfo,cpuinfo,tgobj,cgobj,cgllvm,cghlcpu; procinfo,cpuinfo,cgobj,cgllvm,cghlcpu;
const const
topcg2llvmop: array[topcg] of tllvmop = topcg2llvmop: array[topcg] of tllvmop =
@ -157,6 +159,15 @@ implementation
inherited inherited
end; end;
procedure thlcgllvm.temp_to_ref(p: ptemprecord; out ref: treference);
begin
{ on the LLVM target, every temp is independent and encoded via a
separate temp register whose superregister number is stored in p^.pos }
reference_reset_base(ref,voidstackpointertype,newreg(R_TEMPREGISTER,p^.pos,R_SUBWHOLE),0,p^.alignment);
end;
procedure thlcgllvm.a_load_ref_cgpara(list: TAsmList; size: tdef; const r: treference; const cgpara: TCGPara); procedure thlcgllvm.a_load_ref_cgpara(list: TAsmList; size: tdef; const r: treference; const cgpara: TCGPara);
var var
tmpref, initialref, ref: treference; tmpref, initialref, ref: treference;