This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: More Objective-C frontend cleanup


In this episode, we use NULL_TREE and replace old fprintf calls
with {error,warning}_with_file_and_line.  Bootstrapped on
powerpc-apple-darwin1.3, committed to mainline.

Stan

2001-03-20  Stan Shebs  <shebs@apple.com>

        * objc/objc-act.c (get_static_reference): Use NULL_TREE.
        (get_object_reference): Ditto.
        (error_with_ivar): Use error_with_file_and_line.
        (warn_with_method): Use warning_with_file_and_line.

Index: objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.73
diff -c -3 -p -r1.73 objc-act.c
*** objc-act.c	2001/03/20 02:57:28	1.73
--- objc-act.c	2001/03/20 21:44:57
*************** get_static_reference (interface, protoco
*** 1126,1132 ****
  	 (in build_pointer_type)...so that the new template
  	 we just created will actually be used...what a hack!  */
        if (TYPE_POINTER_TO (t))
! 	TYPE_POINTER_TO (t) = 0;
  
        type = t;
      }
--- 1126,1132 ----
  	 (in build_pointer_type)...so that the new template
  	 we just created will actually be used...what a hack!  */
        if (TYPE_POINTER_TO (t))
! 	TYPE_POINTER_TO (t) = NULL_TREE;
  
        type = t;
      }
*************** get_object_reference (protocols)
*** 1176,1182 ****
  	 (in build_pointer_type)...so that the new template
  	 we just created will actually be used...what a hack!  */
        if (TYPE_POINTER_TO (t))
! 	TYPE_POINTER_TO (t) = NULL;
  
        type = t;
      }
--- 1176,1182 ----
  	 (in build_pointer_type)...so that the new template
  	 we just created will actually be used...what a hack!  */
        if (TYPE_POINTER_TO (t))
! 	TYPE_POINTER_TO (t) = NULL_TREE;
  
        type = t;
      }
*************** error_with_ivar (message, decl, rawdecl)
*** 3616,3625 ****
  
    report_error_function (DECL_SOURCE_FILE (decl));
  
!   fprintf (stderr, "%s:%d: ",
! 	   DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
!   memset (errbuf, 0, BUFSIZE);
!   fprintf (stderr, "%s `%s'\n", message, gen_declaration (rawdecl, errbuf));
  }
  
  #define USERTYPE(t) \
--- 3616,3628 ----
  
    report_error_function (DECL_SOURCE_FILE (decl));
  
!   strcpy (errbuf, message);
!   strcat (errbuf, " `");
!   gen_declaration (rawdecl, errbuf + strlen (errbuf));
!   strcat (errbuf, "'");
!   error_with_file_and_line (DECL_SOURCE_FILE (decl),
! 			    DECL_SOURCE_LINE (decl),
! 			    errbuf);
  }
  
  #define USERTYPE(t) \
*************** warn_with_method (message, mtype, method
*** 7043,7053 ****
  
    report_error_function (DECL_SOURCE_FILE (method));
  
!   fprintf (stderr, "%s:%d: warning: ",
! 	   DECL_SOURCE_FILE (method), DECL_SOURCE_LINE (method));
!   memset (errbuf, 0, BUFSIZE);
!   fprintf (stderr, "%s `%c%s'\n",
! 	   message, mtype, gen_method_decl (method, errbuf));
  }
  
  /* Return 1 if METHOD is consistent with PROTO.  */
--- 7046,7059 ----
  
    report_error_function (DECL_SOURCE_FILE (method));
  
!   /* Add a readable method name to the warning.  */
!   sprintf (errbuf, "%s `%c", message, mtype);
!   gen_method_decl (method, errbuf + strlen (errbuf));
!   strcat (errbuf, "'");
! 
!   warning_with_file_and_line (DECL_SOURCE_FILE (method),
! 			      DECL_SOURCE_LINE (method),
! 			      errbuf);
  }
  
  /* Return 1 if METHOD is consistent with PROTO.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]