2
0
Эх сурвалжийг харах

+ support for get_frame() for the LLVM target (using the llvm.frameaddress()
intrinsic)

git-svn-id: trunk@31409 -

Jonas Maebe 10 жил өмнө
parent
commit
677595880a

+ 15 - 3
compiler/llvm/nllvminl.pas

@@ -26,10 +26,14 @@ unit nllvminl;
 interface
 
     uses
+      node,
       ncginl;
 
     type
       tllvminlinenode = class(tcginlinenode)
+       protected
+        function first_get_frame: tnode; override;
+       public
         procedure second_length; override;
       end;
 
@@ -37,12 +41,20 @@ interface
 implementation
 
      uses
-       verbose,globtype,
+       verbose,globtype,constexp,
        aasmbase, aasmdata,
        symtype,symdef,defutil,
-       ninl,
+       ncal,ncon,ninl,
        pass_2,
-       cgbase,cgutils,tgobj,hlcgobj;
+       cgbase,cgutils,tgobj,hlcgobj,
+       cpubase;
+
+
+     function tllvminlinenode.first_get_frame: tnode;
+       begin
+         result:=ccallnode.createintern('llvm_frameaddress',
+           ccallparanode.create(genintconstnode(0),nil));
+       end;
 
 
     procedure tllvminlinenode.second_length;

+ 1 - 0
rtl/inc/llvmintr.inc

@@ -16,3 +16,4 @@
 
 procedure llvm_memcpy64(dest, source: pointer; len: qword; align: cardinal; isvolatile: boolean); compilerproc; external name 'llvm.memcpy.p0i8.p0i8.i64';
 
+function llvm_frameaddress(level: longint): pointer; compilerproc; external name 'llvm.frameaddress';