Jelajahi Sumber

* nf_internal flag for internal inserted typeconvs. This will
supress the generation of warning/hints

peter 21 tahun lalu
induk
melakukan
2e161c5e9e
10 mengubah file dengan 136 tambahan dan 83 penghapusan
  1. 25 21
      compiler/nadd.pas
  2. 8 6
      compiler/ncal.pas
  3. 34 16
      compiler/ncnv.pas
  4. 20 16
      compiler/ninl.pas
  5. 9 5
      compiler/nld.pas
  6. 7 3
      compiler/nmem.pas
  7. 6 1
      compiler/node.pas
  8. 8 4
      compiler/nutils.pas
  9. 8 4
      compiler/pinline.pas
  10. 11 7
      compiler/psub.pas

+ 25 - 21
compiler/nadd.pas

@@ -171,7 +171,7 @@ implementation
                (right.resulttype.def.deftype=orddef) then
              begin
                { insert explicit typecast to default signed int }
-               left:=ctypeconvnode.create_explicit(left,sinttype);
+               left:=ctypeconvnode.create_internal(left,sinttype);
                resulttypepass(left);
              end
             else
@@ -179,7 +179,7 @@ implementation
                 (right.resulttype.def.deftype=enumdef) then
               begin
                 { insert explicit typecast to default signed int }
-                right:=ctypeconvnode.create_explicit(right,sinttype);
+                right:=ctypeconvnode.create_internal(right,sinttype);
                 resulttypepass(right);
               end;
           end;
@@ -667,13 +667,13 @@ implementation
               begin
                 if torddef(left.resulttype.def).size>torddef(right.resulttype.def).size then
                  begin
-                   right:=ctypeconvnode.create_explicit(right,left.resulttype);
+                   right:=ctypeconvnode.create_internal(right,left.resulttype);
                    ttypeconvnode(right).convtype:=tc_bool_2_int;
                    resulttypepass(right);
                  end
                 else if torddef(left.resulttype.def).size<torddef(right.resulttype.def).size then
                  begin
-                   left:=ctypeconvnode.create_explicit(left,right.resulttype);
+                   left:=ctypeconvnode.create_internal(left,right.resulttype);
                    ttypeconvnode(left).convtype:=tc_bool_2_int;
                    resulttypepass(left);
                  end;
@@ -785,9 +785,9 @@ implementation
                      is_integer(ld) and is_integer(rd) then
                begin
                  if rd.size>ld.size then
-                   inserttypeconv_explicit(left,right.resulttype)
+                   inserttypeconv_internal(left,right.resulttype)
                  else
-                   inserttypeconv_explicit(right,left.resulttype);
+                   inserttypeconv_internal(right,left.resulttype);
                end
              { is there a signed 64 bit type ? }
              else if ((torddef(rd).typ=s64bit) or (torddef(ld).typ=s64bit)) then
@@ -983,8 +983,8 @@ implementation
                     { a voidpointer of 8 bytes). A conversion to voidpointer would be  }
                     { optimized away, since the result already was a voidpointer, so   }
                     { use a charpointer instead (JM)                                   }
-                    inserttypeconv_explicit(left,charpointertype);
-                    inserttypeconv_explicit(right,charpointertype);
+                    inserttypeconv_internal(left,charpointertype);
+                    inserttypeconv_internal(right,charpointertype);
                  end;
                ltn,lten,gtn,gten:
                  begin
@@ -1269,8 +1269,8 @@ implementation
               begin
                 { convert both to voidpointer, because methodpointers are 8 bytes }
                 { even though only the first 4 bytes must be compared (JM)        }
-                inserttypeconv_explicit(left,voidpointertype);
-                inserttypeconv_explicit(right,voidpointertype);
+                inserttypeconv_internal(left,voidpointertype);
+                inserttypeconv_internal(right,voidpointertype);
               end
             else
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
@@ -1384,7 +1384,7 @@ implementation
                       { compare the pointer with nil (for ansistrings etc), }
                       { faster than getting the length (JM)                 }
                       result:= caddnode.create(nodetype,
-                        ctypeconvnode.create_explicit(left,voidpointertype),
+                        ctypeconvnode.create_internal(left,voidpointertype),
                         cpointerconstnode.create(0,voidpointertype));
                     end;
                   { left is reused }
@@ -1438,8 +1438,8 @@ implementation
                    end;
                end;
                { convert the arguments (explicitely) to fpc_normal_set's }
-               left := ctypeconvnode.create_explicit(left,srsym.restype);
-               right := ctypeconvnode.create_explicit(right,srsym.restype);
+               left := ctypeconvnode.create_internal(left,srsym.restype);
+               right := ctypeconvnode.create_internal(right,srsym.restype);
                result := ccallnode.createintern(procname,ccallparanode.create(right,
                  ccallparanode.create(left,nil)));
                { left and right are reused as parameters }
@@ -1459,7 +1459,7 @@ implementation
                   { type cast the value to pass as argument to a byte, }
                   { since that's what the helper expects               }
                   tsetelementnode(right).left :=
-                    ctypeconvnode.create_explicit(tsetelementnode(right).left,u8inttype);
+                    ctypeconvnode.create_internal(tsetelementnode(right).left,u8inttype);
                   { set the resulttype to the actual one (otherwise it's }
                   { "fpc_normal_set")                                    }
                   result := ccallnode.createinternres('fpc_set_create_element',
@@ -1475,18 +1475,18 @@ implementation
                      { convert the arguments to bytes, since that's what }
                      { the helper expects                               }
                      tsetelementnode(right).left :=
-                       ctypeconvnode.create_explicit(tsetelementnode(right).left,
+                       ctypeconvnode.create_internal(tsetelementnode(right).left,
                        u8inttype);
 
                      { convert the original set (explicitely) to an   }
                      { fpc_normal_set so we can pass it to the helper }
-                     left := ctypeconvnode.create_explicit(left,srsym.restype);
+                     left := ctypeconvnode.create_internal(left,srsym.restype);
 
                      { add a range or a single element? }
                      if assigned(tsetelementnode(right).right) then
                        begin
                          tsetelementnode(right).right :=
-                           ctypeconvnode.create_explicit(tsetelementnode(right).right,
+                           ctypeconvnode.create_internal(tsetelementnode(right).right,
                            u8inttype);
 
                          { create the call }
@@ -1515,7 +1515,7 @@ implementation
                        ccallparanode.create(
                          ctypeconvnode.create_explicit(right,srsym.restype),
                        ccallparanode.create(
-                         ctypeconvnode.create_explicit(left,srsym.restype),nil)),resulttype);
+                         ctypeconvnode.create_internal(left,srsym.restype),nil)),resulttype);
                      { remove reused parts from original node }
                      left := nil;
                      right := nil;
@@ -1525,8 +1525,8 @@ implementation
           subn,symdifn,muln:
             begin
               { convert the sets to fpc_normal_set's }
-              paras := ccallparanode.create(ctypeconvnode.create_explicit(right,srsym.restype),
-                ccallparanode.create(ctypeconvnode.create_explicit(left,srsym.restype),nil));
+              paras := ccallparanode.create(ctypeconvnode.create_internal(right,srsym.restype),
+                ccallparanode.create(ctypeconvnode.create_internal(left,srsym.restype),nil));
               case nodetype of
                 subn:
                   result := ccallnode.createinternres('fpc_set_sub_sets',
@@ -2032,7 +2032,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.130  2004-11-01 12:43:28  peter
+  Revision 1.131  2004-11-02 12:55:16  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.130  2004/11/01 12:43:28  peter
     * shortstr compare with empty string fixed
     * removed special i386 code
 

+ 8 - 6
compiler/ncal.pas

@@ -343,7 +343,7 @@ type
             if not assigned(hightree) then
               internalerror(200304071);
             { Need to use explicit, because it can also be a enum }
-            hightree:=ctypeconvnode.create_explicit(hightree,s32inttype);
+            hightree:=ctypeconvnode.create_internal(hightree,s32inttype);
           end;
         result:=hightree;
       end;
@@ -1128,7 +1128,7 @@ type
         { Load tmehodpointer(right).self }
         result:=csubscriptnode.create(
                      hsym,
-                     ctypeconvnode.create_explicit(right.getcopy,methodpointertype));
+                     ctypeconvnode.create_internal(right.getcopy,methodpointertype));
       end;
 
 
@@ -2038,9 +2038,7 @@ type
                     addstatement(createstatement,tempnode);
                     addstatement(createstatement,cassignmentnode.create(ctemprefnode.create(tempnode),
                       caddrnode.create(para.left)));
-                    hp := cderefnode.create(ctemprefnode.create(tempnode));
-                    inserttypeconv_explicit(hp,para.left.resulttype);
-                    para.left := hp;
+                    para.left := ctypeconvnode.create_internal(cderefnode.create(ctemprefnode.create(tempnode)),para.left.resulttype);
                     addstatement(deletestatement,ctempdeletenode.create(tempnode));
                   end;
                 para := tcallparanode(para.right);
@@ -2416,7 +2414,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.256  2004-11-01 18:16:48  peter
+  Revision 1.257  2004-11-02 12:55:16  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.256  2004/11/01 18:16:48  peter
     * removed wrong check for symtableprocentry
 
   Revision 1.255  2004/11/01 16:58:57  peter

+ 34 - 16
compiler/ncnv.pas

@@ -39,6 +39,7 @@ interface
           convtype : tconverttype;
           constructor create(node : tnode;const t : ttype);virtual;
           constructor create_explicit(node : tnode;const t : ttype);
+          constructor create_internal(node : tnode;const t : ttype);
           constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderefimpl;override;
@@ -190,7 +191,7 @@ interface
        cisnode : tisnodeclass;
 
     procedure inserttypeconv(var p:tnode;const t:ttype);
-    procedure inserttypeconv_explicit(var p:tnode;const t:ttype);
+    procedure inserttypeconv_internal(var p:tnode;const t:ttype);
     procedure arrayconstructor_to_set(var p : tnode);
 
 
@@ -235,7 +236,7 @@ implementation
       end;
 
 
-    procedure inserttypeconv_explicit(var p:tnode;const t:ttype);
+    procedure inserttypeconv_internal(var p:tnode;const t:ttype);
 
       begin
         if not assigned(p.resulttype.def) then
@@ -255,11 +256,12 @@ implementation
          end
         else
          begin
-           p:=ctypeconvnode.create_explicit(p,t);
+           p:=ctypeconvnode.create_internal(p,t);
            resulttypepass(p);
          end;
       end;
 
+
 {*****************************************************************************
                     Array constructor to Set Conversion
 *****************************************************************************}
@@ -514,6 +516,16 @@ implementation
       end;
 
 
+    constructor ttypeconvnode.create_internal(node : tnode;const t:ttype);
+
+      begin
+         self.create(node,t);
+         { handle like explicit conversions }
+         include(flags,nf_explicit);
+         include(flags,nf_internal);
+      end;
+
+
     constructor ttypeconvnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
       begin
         inherited ppuload(t,ppufile);
@@ -738,7 +750,7 @@ implementation
              begin
                { create word(byte(char) shl 8 or 1) for litte endian machines }
                { and word(byte(char) or 256) for big endian machines          }
-               left := ctypeconvnode.create_explicit(left,u8inttype);
+               left := ctypeconvnode.create_internal(left,u8inttype);
                if (target_info.endian = endian_little) then
                  left := caddnode.create(orn,
                    cshlshrnode.create(shln,left,cordconstnode.create(8,s32inttype,false)),
@@ -746,7 +758,7 @@ implementation
                else
                  left := caddnode.create(orn,left,
                    cordconstnode.create(1 shl 8,s32inttype,false));
-               left := ctypeconvnode.create_explicit(left,u16inttype);
+               left := ctypeconvnode.create_internal(left,u16inttype);
                resulttypepass(left);
              end;
       end;
@@ -989,7 +1001,7 @@ implementation
       begin
         { a dynamic array is a pointer to an array, so to convert it to }
         { an open array, we have to dereference it (JM)                 }
-        result := ctypeconvnode.create_explicit(left,voidpointertype);
+        result := ctypeconvnode.create_internal(left,voidpointertype);
         resulttypepass(result);
         { left is reused }
         left := nil;
@@ -1036,8 +1048,8 @@ implementation
     function ttypeconvnode.resulttype_variant_to_enum : tnode;
 
       begin
-        result := ctypeconvnode.create_explicit(left,sinttype);
-        result := ctypeconvnode.create_explicit(result,resulttype);
+        result := ctypeconvnode.create_internal(left,sinttype);
+        result := ctypeconvnode.create_internal(result,resulttype);
         resulttypepass(result);
         { left is reused }
         left := nil;
@@ -1047,8 +1059,8 @@ implementation
     function ttypeconvnode.resulttype_enum_to_variant : tnode;
 
       begin
-        result := ctypeconvnode.create_explicit(left,sinttype);
-        result := ctypeconvnode.create_explicit(result,cvarianttype);
+        result := ctypeconvnode.create_internal(left,sinttype);
+        result := ctypeconvnode.create_internal(result,cvarianttype);
         resulttypepass(result);
         { left is reused }
         left := nil;
@@ -1339,7 +1351,7 @@ implementation
                      end;
                      { we need explicit, because it can also be an enum }
                      if assigned(htype.def) then
-                       inserttypeconv_explicit(left,htype)
+                       inserttypeconv_internal(left,htype)
                      else
                        CGMessage2(type_e_illegal_type_conversion,left.resulttype.def.gettypename,resulttype.def.gettypename);
                    end;
@@ -1370,7 +1382,8 @@ implementation
                      else
                       begin
                         { check if the types are related }
-                        if (not(tobjectdef(left.resulttype.def).is_related(tobjectdef(resulttype.def)))) and
+                        if not(nf_internal in flags) and
+                           (not(tobjectdef(left.resulttype.def).is_related(tobjectdef(resulttype.def)))) and
                            (not(tobjectdef(resulttype.def).is_related(tobjectdef(left.resulttype.def)))) then
                           begin
                             { Give an error when typecasting class to interface, this is compatible
@@ -1416,7 +1429,8 @@ implementation
         { Give hint or warning for unportable code, exceptions are
            - typecasts from constants
            - void }
-        if (left.nodetype<>ordconstn) and
+        if not(nf_internal in flags) and
+           (left.nodetype<>ordconstn) and
            not(is_void(left.resulttype.def)) and
            (((left.resulttype.def.deftype=orddef) and
              (resulttype.def.deftype in [pointerdef,procvardef,classrefdef])) or
@@ -1682,7 +1696,7 @@ implementation
          { convert to a 64bit int (only necessary for 32bit processors) (JM) }
          if resulttype.def.size > sizeof(aint) then
            begin
-             result := ctypeconvnode.create_explicit(left,u32inttype);
+             result := ctypeconvnode.create_internal(left,u32inttype);
              result := ctypeconvnode.create(result,resulttype);
              left := nil;
              firstpass(result);
@@ -1764,7 +1778,7 @@ implementation
         { reused }
         left := nil;
         { convert parameter explicitely to fpc_small_set }
-        p.left := ctypeconvnode.create_explicit(p.left,srsym.restype);
+        p.left := ctypeconvnode.create_internal(p.left,srsym.restype);
         { create call, adjust resulttype }
         result :=
           ccallnode.createinternres('fpc_set_load_small',p,resulttype);
@@ -2467,7 +2481,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.160  2004-11-01 23:30:11  peter
+  Revision 1.161  2004-11-02 12:55:16  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.160  2004/11/01 23:30:11  peter
     * support > 32bit accesses for x86_64
     * rewrote array size checking to support 64bit
 

+ 20 - 16
compiler/ninl.pas

@@ -392,7 +392,7 @@ implementation
             { create a new fileparameter as follows: file_type(temp^)    }
             { (so that we pass the value and not the address of the temp }
             { to the read/write routine)                                 }
-            filepara := ccallparanode.create(ctypeconvnode.create_explicit(
+            filepara := ccallparanode.create(ctypeconvnode.create_internal(
               cderefnode.create(ctemprefnode.create(filetemp)),srsym.vartype),nil);
           end
         else
@@ -427,7 +427,7 @@ implementation
                 { create a new fileparameter as follows: file_type(temp^)    }
                 { (so that we pass the value and not the address of the temp }
                 { to the read/write routine)                                 }
-                nextpara := ccallparanode.create(ctypeconvnode.create_explicit(
+                nextpara := ccallparanode.create(ctypeconvnode.create_internal(
                   cderefnode.create(ctemprefnode.create(filetemp)),filepara.left.resulttype),nil);
 
                 { replace the old file para with the new one }
@@ -958,7 +958,7 @@ implementation
           { and cardinals are fine. Since the formal code para type is      }
           { longint, insert a typecoversion to longint for cardinal para's  }
           begin
-            codepara.left := ctypeconvnode.create_explicit(codepara.left,sinttype);
+            codepara.left := ctypeconvnode.create_internal(codepara.left,sinttype);
             { make it explicit, oterwise you may get a nonsense range }
             { check error if the cardinal already contained a value   }
             { > $7fffffff                                             }
@@ -1488,7 +1488,7 @@ implementation
                            uchar:
                              begin
                                { change to byte() }
-                               hp:=ctypeconvnode.create_explicit(left,u8inttype);
+                               hp:=ctypeconvnode.create_internal(left,u8inttype);
                                left:=nil;
                                result:=hp;
                              end;
@@ -1496,14 +1496,14 @@ implementation
                            uwidechar :
                              begin
                                { change to word() }
-                               hp:=ctypeconvnode.create_explicit(left,u16inttype);
+                               hp:=ctypeconvnode.create_internal(left,u16inttype);
                                left:=nil;
                                result:=hp;
                              end;
                            bool32bit :
                              begin
                                { change to dword() }
-                               hp:=ctypeconvnode.create_explicit(left,u32inttype);
+                               hp:=ctypeconvnode.create_internal(left,u32inttype);
                                left:=nil;
                                result:=hp;
                              end;
@@ -1520,7 +1520,7 @@ implementation
                        end;
                      enumdef :
                        begin
-                         hp:=ctypeconvnode.create_explicit(left,s32inttype);
+                         hp:=ctypeconvnode.create_internal(left,s32inttype);
                          left:=nil;
                          result:=hp;
                        end;
@@ -1528,7 +1528,7 @@ implementation
                        begin
                          if m_mac in aktmodeswitches then
                            begin
-                             hp:=ctypeconvnode.create_explicit(left,ptrinttype);
+                             hp:=ctypeconvnode.create_internal(left,ptrinttype);
                              left:=nil;
                              result:=hp;
                            end
@@ -1544,7 +1544,7 @@ implementation
                 begin
                    { convert to explicit char() }
                    set_varstate(left,vs_used,true);
-                   hp:=ctypeconvnode.create_explicit(left,cchartype);
+                   hp:=ctypeconvnode.create_internal(left,cchartype);
                    left:=nil;
                    result:=hp;
                 end;
@@ -1636,7 +1636,7 @@ implementation
                           end
                         else
                           begin
-                            hp := ccallparanode.create(ctypeconvnode.create_explicit(left,voidpointertype),nil);
+                            hp := ccallparanode.create(ctypeconvnode.create_internal(left,voidpointertype),nil);
                             result := ccallnode.createintern('fpc_dynarray_length',hp);
                             { make sure the left node doesn't get disposed, since it's }
                             { reused in the new node (JM)                              }
@@ -1756,7 +1756,7 @@ implementation
                           if assigned(tcallparanode(left).right) then
                            begin
                              set_varstate(tcallparanode(tcallparanode(left).right).left,vs_used,true);
-                             inserttypeconv_explicit(tcallparanode(tcallparanode(left).right).left,tcallparanode(left).left.resulttype);
+                             inserttypeconv_internal(tcallparanode(tcallparanode(left).right).left,tcallparanode(left).left.resulttype);
                              if assigned(tcallparanode(tcallparanode(left).right).right) then
                                CGMessage(parser_e_illegal_expression);
                            end;
@@ -1860,7 +1860,7 @@ implementation
                               begin
                                 { can't use inserttypeconv because we need }
                                 { an explicit type conversion (JM)         }
-                                hp := ccallparanode.create(ctypeconvnode.create_explicit(left,voidpointertype),nil);
+                                hp := ccallparanode.create(ctypeconvnode.create_internal(left,voidpointertype),nil);
                                 result := ccallnode.createintern('fpc_dynarray_high',hp);
                                 { make sure the left node doesn't get disposed, since it's }
                                 { reused in the new node (JM)                              }
@@ -2093,10 +2093,10 @@ implementation
                   shiftconst := 8;
               end;
               if shiftconst <> 0 then
-                result := ctypeconvnode.create_explicit(cshlshrnode.create(shrn,left,
+                result := ctypeconvnode.create_internal(cshlshrnode.create(shrn,left,
                     cordconstnode.create(shiftconst,u32inttype,false)),resulttype)
               else
-                result := ctypeconvnode.create_explicit(left,resulttype);
+                result := ctypeconvnode.create_internal(left,resulttype);
               left := nil;
               firstpass(result);
             end;
@@ -2205,7 +2205,7 @@ implementation
                        addstatement(newstatement,cassignmentnode.create(ctemprefnode.create(tempnode),
                          caddrnode.create(tcallparanode(left).left.getcopy)));
                        hp := cderefnode.create(ctemprefnode.create(tempnode));
-                       inserttypeconv_explicit(hp,tcallparanode(left).left.resulttype);
+                       inserttypeconv_internal(hp,tcallparanode(left).left.resulttype);
                      end
                    else
                      begin
@@ -2442,7 +2442,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.148  2004-11-01 18:26:52  florian
+  Revision 1.149  2004-11-02 12:55:16  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.148  2004/11/01 18:26:52  florian
     - removed unnecessary printnode
 
   Revision 1.147  2004/11/01 17:41:28  florian

+ 9 - 5
compiler/nld.pas

@@ -593,7 +593,7 @@ implementation
          begin
            hp:=ccallparanode.create(caddrnode.create
                    (crttinode.create(tstoreddef(left.resulttype.def),initrtti)),
-               ccallparanode.create(ctypeconvnode.create_explicit(left,voidpointertype),nil));
+               ccallparanode.create(ctypeconvnode.create_internal(left,voidpointertype),nil));
            result := ccallnode.createintern('fpc_dynarray_clear',hp);
            left:=nil;
            exit;
@@ -665,9 +665,9 @@ implementation
         { call helpers for interface }
         if is_interfacecom(left.resulttype.def) then
          begin
-           hp:=ccallparanode.create(ctypeconvnode.create_explicit
+           hp:=ccallparanode.create(ctypeconvnode.create_internal
                    (right,voidpointertype),
-               ccallparanode.create(ctypeconvnode.create_explicit
+               ccallparanode.create(ctypeconvnode.create_internal
                    (left,voidpointertype),nil));
            result:=ccallnode.createintern('fpc_intf_assign',hp);
            left:=nil;
@@ -938,7 +938,7 @@ implementation
                begin
                  case hp.left.resulttype.def.deftype of
                    enumdef :
-                     hp.left:=ctypeconvnode.create_explicit(hp.left,s32inttype);
+                     hp.left:=ctypeconvnode.create_internal(hp.left,s32inttype);
                    arraydef :
                      hp.left:=ctypeconvnode.create(hp.left,charpointertype);
                    orddef :
@@ -1168,7 +1168,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.137  2004-11-01 15:32:12  peter
+  Revision 1.138  2004-11-02 12:55:16  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.137  2004/11/01 15:32:12  peter
     * support @labelsym
 
   Revision 1.136  2004/10/31 21:45:03  peter

+ 7 - 3
compiler/nmem.pas

@@ -769,9 +769,9 @@ implementation
             (is_ansistring(left.resulttype.def) or
              is_widestring(left.resulttype.def)) then
            begin
-             left := ctypeconvnode.create_explicit(ccallnode.createintern('fpc_'+tstringdef(left.resulttype.def).stringtypname+'_unique',
+             left := ctypeconvnode.create_internal(ccallnode.createintern('fpc_'+tstringdef(left.resulttype.def).stringtypname+'_unique',
                ccallparanode.create(
-                 ctypeconvnode.create_explicit(left,voidpointertype),nil)),
+                 ctypeconvnode.create_internal(left,voidpointertype),nil)),
                left.resulttype);
              firstpass(left);
              { double resulttype passes somwhere else may cause this to be }
@@ -982,7 +982,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.86  2004-09-26 17:45:30  peter
+  Revision 1.87  2004-11-02 12:55:16  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.86  2004/09/26 17:45:30  peter
     * simple regvar support, not yet finished
 
   Revision 1.85  2004/06/20 08:55:29  florian

+ 6 - 1
compiler/node.pas

@@ -234,6 +234,7 @@ interface
 
          { ttypeconvnode }
          nf_explicit,
+         nf_internal,  { no warnings/hints generated }
 
          { tinlinenode }
          nf_inlineconst,
@@ -1135,7 +1136,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.89  2004-11-01 17:15:47  peter
+  Revision 1.90  2004-11-02 12:55:16  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.89  2004/11/01 17:15:47  peter
     * no checkpointer code for dynarr to openarr
 
   Revision 1.88  2004/10/31 21:45:03  peter

+ 8 - 4
compiler/nutils.pas

@@ -373,11 +373,11 @@ implementation
               para:=ccallparanode.create(
                         cordconstnode.create(current_procinfo.procdef._class.vmt_offset,s32inttype,false),
                     ccallparanode.create(
-                        ctypeconvnode.create_explicit(
+                        ctypeconvnode.create_internal(
                             load_vmt_pointer_node,
                             voidpointertype),
                     ccallparanode.create(
-                        ctypeconvnode.create_explicit(
+                        ctypeconvnode.create_internal(
                             load_self_pointer_node,
                             voidpointertype),
                     nil)));
@@ -405,7 +405,7 @@ implementation
            is_dynamic_array(p.resulttype.def) then
           begin
             result:=cassignmentnode.create(
-               ctypeconvnode.create_explicit(p,voidpointertype),
+               ctypeconvnode.create_internal(p,voidpointertype),
                cnilnode.create
                );
           end
@@ -519,7 +519,11 @@ end.
 
 {
   $Log$
-  Revision 1.19  2004-08-25 15:54:46  peter
+  Revision 1.20  2004-11-02 12:55:16  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.19  2004/08/25 15:54:46  peter
     * fix possible wrong typecast
 
   Revision 1.18  2004/08/04 08:35:59  jonas

+ 8 - 4
compiler/pinline.pas

@@ -501,7 +501,7 @@ implementation
                       (counter,s32inttype,true),
                    ccallparanode.create(caddrnode.create
                       (crttinode.create(tstoreddef(destppn.resulttype.def),initrtti)),
-                   ccallparanode.create(ctypeconvnode.create_explicit(destppn,voidpointertype),nil))));
+                   ccallparanode.create(ctypeconvnode.create_internal(destppn,voidpointertype),nil))));
             addstatement(newstatement,ccallnode.createintern('fpc_dynarray_setlength',npara));
             addstatement(newstatement,ctempdeletenode.create(temp));
 
@@ -727,9 +727,9 @@ implementation
                    ccallparanode.create(caddrnode.create
                       (crttinode.create(tstoreddef(ppn.left.resulttype.def),initrtti)),
                    ccallparanode.create
-                      (ctypeconvnode.create_explicit(ppn.left,voidpointertype),
+                      (ctypeconvnode.create_internal(ppn.left,voidpointertype),
                    ccallparanode.create
-                      (ctypeconvnode.create_explicit(ctemprefnode.create(temp),voidpointertype),nil)))));
+                      (ctypeconvnode.create_internal(ctemprefnode.create(temp),voidpointertype),nil)))));
             addstatement(newstatement,ccallnode.createintern('fpc_dynarray_copy',npara));
 
             { convert the temp to normal and return the reference to the
@@ -754,7 +754,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.34  2004-11-01 10:32:27  peter
+  Revision 1.35  2004-11-02 12:55:16  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.34  2004/11/01 10:32:27  peter
     * temp for dynarray copy needs to be typed
 
   Revision 1.33  2004/10/15 09:14:17  mazen

+ 11 - 7
compiler/psub.pas

@@ -299,7 +299,7 @@ implementation
                                 load_vmt_pointer_node,
                                 cnilnode.create),
                             cassignmentnode.create(
-                                ctypeconvnode.create_explicit(
+                                ctypeconvnode.create_internal(
                                     load_self_pointer_node,
                                     voidpointertype),
                                 ccallnode.create(nil,tprocsym(srsym),srsym.owner,load_vmt_pointer_node,[])),
@@ -321,16 +321,16 @@ implementation
                       para:=ccallparanode.create(
                                 cordconstnode.create(current_procinfo.procdef._class.vmt_offset,s32inttype,false),
                             ccallparanode.create(
-                                ctypeconvnode.create_explicit(
+                                ctypeconvnode.create_internal(
                                     load_vmt_pointer_node,
                                     voidpointertype),
                             ccallparanode.create(
-                                ctypeconvnode.create_explicit(
+                                ctypeconvnode.create_internal(
                                     load_self_pointer_node,
                                     voidpointertype),
                             nil)));
                       addstatement(newstatement,cassignmentnode.create(
-                          ctypeconvnode.create_explicit(
+                          ctypeconvnode.create_internal(
                               load_self_pointer_node,
                               voidpointertype),
                           ccallnode.createintern('fpc_help_constructor',para)));
@@ -444,11 +444,11 @@ implementation
                       para:=ccallparanode.create(
                                 cordconstnode.create(current_procinfo.procdef._class.vmt_offset,s32inttype,false),
                             ccallparanode.create(
-                                ctypeconvnode.create_explicit(
+                                ctypeconvnode.create_internal(
                                     load_vmt_pointer_node,
                                     voidpointertype),
                             ccallparanode.create(
-                                ctypeconvnode.create_explicit(
+                                ctypeconvnode.create_internal(
                                     load_self_pointer_node,
                                     voidpointertype),
                             nil)));
@@ -1403,7 +1403,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.212  2004-10-31 18:54:25  peter
+  Revision 1.213  2004-11-02 12:55:17  peter
+    * nf_internal flag for internal inserted typeconvs. This will
+      supress the generation of warning/hints
+
+  Revision 1.212  2004/10/31 18:54:25  peter
     * $fpctarget expands to <cpu>-<os>
     * allow * in middle of the path to support ../*/units/$fpctarget