Browse Source

Use SUPPORT_SAFECALL conditional

git-svn-id: trunk@22488 -
pierre 13 năm trước cách đây
mục cha
commit
42586baa34
3 tập tin đã thay đổi với 9 bổ sung3 xóa
  1. 6 0
      compiler/paramgr.pas
  2. 1 1
      compiler/pparautl.pas
  3. 2 2
      compiler/psub.pas

+ 6 - 0
compiler/paramgr.pas

@@ -169,6 +169,12 @@ implementation
     { true if uses a parameter as return value }
     function tparamanager.ret_in_param(def : tdef;calloption : tproccalloption) : boolean;
       begin
+        if (tf_safecall_exceptions in target_info.flags) and
+           (calloption=pocall_safecall) then
+          begin
+            result:=true;
+            exit;
+          end;
          ret_in_param:=((def.typ=arraydef) and not(is_dynamic_array(def))) or
            (def.typ=recorddef) or
            (def.typ=stringdef) or

+ 1 - 1
compiler/pparautl.pas

@@ -68,7 +68,7 @@ implementation
                (pd.proccalloption=pocall_safecall)) then
              paranr:=paranr_result_leftright
            else
-{$elseif defined(x86) or defined(arm)}
+{$elseif defined(SUPPORT_SAFECALL)}
            if (tf_safecall_exceptions in target_info.flags) and
               (pd.proccalloption = pocall_safecall)  then
              paranr:=paranr_result_leftright

+ 2 - 2
compiler/psub.pas

@@ -1172,7 +1172,7 @@ implementation
         procdef.parast.SymList.ForEachCall(@check_finalize_paras,nil);
         procdef.localst.SymList.ForEachCall(@check_finalize_locals,nil);
 
-{$if defined(x86) or defined(arm)}
+{$ifdef SUPPORT_SAFECALL}
         { set implicit_finally flag for if procedure is safecall }
         if (tf_safecall_exceptions in target_info.flags) and
            (procdef.proccalloption=pocall_safecall) then
@@ -1464,7 +1464,7 @@ implementation
             current_filepos:=entrypos;
             gen_proc_entry_code(templist);
             aktproccode.insertlistafter(headertai,templist);
-{$if defined(x86) or defined(arm)}
+{$ifdef SUPPORT_SAFECALL}
             { Set return value of safecall procedure if implicit try/finally blocks are disabled }
             if not (cs_implicit_exceptions in current_settings.moduleswitches) and
                (tf_safecall_exceptions in target_info.flags) and