Browse Source

* factored symansistr-define-conditional handling of fforcedprocname into
a property

git-svn-id: trunk@30944 -

Jonas Maebe 10 năm trước cách đây
mục cha
commit
0eab091e1a
2 tập tin đã thay đổi với 17 bổ sung7 xóa
  1. 16 0
      compiler/ncal.pas
  2. 1 7
      compiler/ncgcal.pas

+ 16 - 0
compiler/ncal.pas

@@ -62,6 +62,7 @@ interface
        private
           { number of parameters passed from the source, this does not include the hidden parameters }
           paralength   : smallint;
+          function getforcedprocname: TSymStr;
           function  is_simple_para_load(p:tnode; may_be_in_reg: boolean):boolean;
           procedure maybe_load_in_temp(var p:tnode);
           function  gen_high_tree(var p:tnode;paradef:tdef):tnode;
@@ -109,6 +110,7 @@ interface
 {$else symansistr}
           fforcedprocname: pshortstring;
 {$endif symansistr}
+          property forcedprocname: TSymStr read getforcedprocname;
        public
           { the symbol containing the definition of the procedure }
           { to call                                               }
@@ -1818,6 +1820,20 @@ implementation
           end;
       end;
 
+
+    function tcallnode.getforcedprocname: TSymStr;
+      begin
+{$ifdef symansistr}
+        result:=fforcedprocname;
+{$else}
+        if assigned(fforcedprocname) then
+          result:=fforcedprocname^
+        else
+          result:='';
+{$endif}
+      end;
+
+
     function look_for_call(var n: tnode; arg: pointer): foreachnoderesult;
       begin
         case n.nodetype of

+ 1 - 7
compiler/ncgcal.pas

@@ -987,13 +987,7 @@ implementation
                end;
 {$endif vtentry}
 
-{$ifdef symansistr}
-              name_to_call:=fforcedprocname;
-{$else symansistr}
-              name_to_call:='';
-              if assigned(fforcedprocname) then
-                name_to_call:=fforcedprocname^;
-{$endif symansistr}
+             name_to_call:=forcedprocname;
              { When methodpointer is typen we don't need (and can't) load
                a pointer. We can directly call the correct procdef (PFV) }
              if (name_to_call='') and