浏览代码

* implement dogetcopy for the Aarch64 variant of the tryfinally node

git-svn-id: trunk@44957 -
svenbarth 5 年之前
父节点
当前提交
2aa0e50873
共有 1 个文件被更改,包括 21 次插入0 次删除
  1. 21 0
      compiler/aarch64/ncpuflw.pas

+ 21 - 0
compiler/aarch64/ncpuflw.pas

@@ -47,6 +47,7 @@ interface
       constructor create_implicit(l,r:TNode);override;
       function simplify(forinline: boolean): tnode;override;
       procedure pass_generate_code;override;
+      function dogetcopy:tnode;override;
     end;
 
 implementation
@@ -346,6 +347,26 @@ procedure taarch64tryfinallynode.pass_generate_code;
     flowcontrol:=oldflowcontrol;
   end;
 
+function taarch64tryfinallynode.dogetcopy: tnode;
+  var
+    p : taarch64tryfinallynode absolute result;
+  begin
+    result:=inherited dogetcopy;
+    if (target_info.system=system_aarch64_win64) then
+      begin
+        if df_generic in current_procinfo.procdef.defoptions then
+          InternalError(2020033101);
+
+        p.finalizepi:=tcgprocinfo(current_procinfo.create_for_outlining('$fin$',current_procinfo.procdef.struct,potype_exceptfilter,voidtype,p.right));
+        if pi_do_call in finalizepi.flags then
+          include(p.finalizepi.flags,pi_do_call);
+        { the init/final code is messing with asm nodes, so inform the compiler about this }
+        include(p.finalizepi.flags,pi_has_assembler_block);
+        if implicitframe then
+          p.finalizepi.allocate_push_parasize(32);
+      end;
+  end;
+
 { taarch64tryexceptnode }
 
 procedure taarch64tryexceptnode.pass_generate_code;