浏览代码

+ tinlinenode calls cpu specific routines for unknown inline numbers

git-svn-id: trunk@37543 -
florian 7 年之前
父节点
当前提交
4752b0ef96
共有 2 个文件被更改,包括 45 次插入3 次删除
  1. 7 1
      compiler/ncginl.pas
  2. 38 2
      compiler/ninl.pas

+ 7 - 1
compiler/ncginl.pas

@@ -31,6 +31,7 @@ interface
     type
        tcginlinenode = class(tinlinenode)
           procedure pass_generate_code;override;
+          procedure pass_generate_code_cpu;virtual;
           procedure second_sizeoftypeof;virtual;
           procedure second_length;virtual;
           procedure second_predsucc;virtual;
@@ -216,11 +217,16 @@ implementation
             in_neg_assign_x,
             in_not_assign_x:
                second_NegNot_assign;
-            else internalerror(9);
+            else
+               pass_generate_code_cpu;
          end;
       end;
 
 
+    procedure tcginlinenode.pass_generate_code_cpu;
+      begin
+        Internalerror(2017110103);
+      end;
 
 {*****************************************************************************
                           SIZEOF / TYPEOF GENERIC HANDLING

+ 38 - 2
compiler/ninl.pas

@@ -38,6 +38,7 @@ interface
           procedure printnodeinfo(var t : text);override;
           function pass_1 : tnode;override;
           function pass_typecheck:tnode;override;
+          function pass_typecheck_cpu:tnode;virtual;
           function simplify(forinline : boolean): tnode;override;
           function docompare(p: tnode): boolean; override;
 
@@ -93,6 +94,9 @@ interface
 {$endif not cpu64bitalu}
           function first_AndOrXorShiftRot_assign: tnode; virtual;
           function first_NegNot_assign: tnode; virtual;
+          function first_cpu : tnode; virtual;
+
+          procedure CheckParameters(count : integer);
         private
           function handle_str: tnode;
           function handle_reset_rewrite_typed: tnode;
@@ -3595,7 +3599,7 @@ implementation
                   result:=handle_concat;
                 end;
               else
-                internalerror(8);
+                result:=pass_typecheck_cpu;
             end;
           end;
 
@@ -3605,6 +3609,12 @@ implementation
       end;
 
 
+    function tinlinenode.pass_typecheck_cpu : tnode;
+      begin
+        internalerror(2017110102);
+      end;
+
+
     function tinlinenode.pass_1 : tnode;
       var
          hp: tnode;
@@ -3985,7 +3995,7 @@ implementation
          in_fma_float128:
            result:=first_fma;
          else
-           internalerror(89);
+           result:=first_cpu;
           end;
        end;
 {$maxfpuregisters default}
@@ -5043,5 +5053,31 @@ implementation
          expectloc:=left.expectloc;
        end;
 
+
+     function tinlinenode.first_cpu : tnode;
+       begin
+         internalerror(2017110101);
+       end;
+
+
+     procedure tinlinenode.CheckParameters(count: integer);
+       var
+         p: tnode;
+       begin
+         if count=1 then
+           set_varstate(left,vs_read,[vsf_must_be_valid])
+         else
+           begin
+             p:=left;
+             while count>0 do
+               begin
+                 set_varstate(tcallparanode(p).left,vs_read,[vsf_must_be_valid]);
+
+                 p:=tcallparanode(p).right;
+                 dec(count);
+               end;
+           end;
+       end;
+
 end.