Browse Source

+ temp_to_ref() implementation for llvm

git-svn-id: branches/hlcgllvm@28491 -
Jonas Maebe 11 years ago
parent
commit
33c277b3a7
1 changed files with 13 additions and 2 deletions
  1. 13 2
      compiler/llvm/hlcgllvm.pas

+ 13 - 2
compiler/llvm/hlcgllvm.pas

@@ -30,7 +30,7 @@ uses
   globtype,cclasses,
   aasmbase,aasmdata,
   symbase,symconst,symtype,symdef,symsym,
-  cpubase, hlcgobj, cgbase, cgutils, parabase;
+  cpubase, hlcgobj, cgbase, cgutils, parabase, tgobj;
 
   type
 
@@ -39,6 +39,8 @@ uses
     thlcgllvm = class(thlcgobj)
       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;
      protected
        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,
     symtable,
     paramgr,llvmpara,
-    procinfo,cpuinfo,tgobj,cgobj,cgllvm,cghlcpu;
+    procinfo,cpuinfo,cgobj,cgllvm,cghlcpu;
 
   const
     topcg2llvmop: array[topcg] of tllvmop =
@@ -157,6 +159,15 @@ implementation
       inherited
     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);
     var
       tmpref, initialref, ref: treference;