浏览代码

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

git-svn-id: trunk@31409 -

Jonas Maebe 10 年之前
父节点
当前提交
677595880a
共有 2 个文件被更改,包括 16 次插入3 次删除
  1. 15 3
      compiler/llvm/nllvminl.pas
  2. 1 0
      rtl/inc/llvmintr.inc

+ 15 - 3
compiler/llvm/nllvminl.pas

@@ -26,10 +26,14 @@ unit nllvminl;
 interface
 interface
 
 
     uses
     uses
+      node,
       ncginl;
       ncginl;
 
 
     type
     type
       tllvminlinenode = class(tcginlinenode)
       tllvminlinenode = class(tcginlinenode)
+       protected
+        function first_get_frame: tnode; override;
+       public
         procedure second_length; override;
         procedure second_length; override;
       end;
       end;
 
 
@@ -37,12 +41,20 @@ interface
 implementation
 implementation
 
 
      uses
      uses
-       verbose,globtype,
+       verbose,globtype,constexp,
        aasmbase, aasmdata,
        aasmbase, aasmdata,
        symtype,symdef,defutil,
        symtype,symdef,defutil,
-       ninl,
+       ncal,ncon,ninl,
        pass_2,
        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;
     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';
 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';