C++: flush friendly_abort()

Zack Weinberg zack@codesourcery.com
Wed Jan 23 09:45:00 GMT 2002


Since Craig changed all the uses of my_friendly_abort to plain abort,
we no longer need the helper routine except for my_friendly_assert,
and that can trivially be changed to use fancy_abort directly.

I've compiled cc1plus with this change but I have not bootstrapped it.

zw

cp:
	* typeck2.c (friendly_abort): Delete definition.
	* cp-tree.h (friendly_abort): Don't prototype.
	(my_friendly_abort): Don't #define.
	(my_friendly_assert): Use fancy_abort.

===================================================================
Index: cp/cp-tree.h
--- cp/cp-tree.h	2002/01/17 13:07:18	1.673
+++ cp/cp-tree.h	2002/01/23 17:40:48
@@ -4347,14 +4347,9 @@ extern tree error_not_base_type			PARAMS
 extern tree binfo_or_else			PARAMS ((tree, tree));
 extern void readonly_error			PARAMS ((tree, const char *, int));
 extern int abstract_virtuals_error		PARAMS ((tree, tree));
-extern void friendly_abort			PARAMS ((int, const char *,
-							 int, const char *))
-  ATTRIBUTE_NORETURN;
 
-#define my_friendly_abort(N) \
-  friendly_abort (N, __FILE__, __LINE__, __FUNCTION__)
 #define my_friendly_assert(EXP, N) (void) \
- (((EXP) == 0) ? (friendly_abort (N, __FILE__, __LINE__, __FUNCTION__), 0) : 0)
+ (((EXP) == 0) ? (fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0) : 0)
 
 extern tree store_init_value			PARAMS ((tree, tree));
 extern tree digest_init				PARAMS ((tree, tree, tree *));
===================================================================
Index: cp/typeck2.c
--- cp/typeck2.c	2002/01/23 14:26:05	1.113
+++ cp/typeck2.c	2002/01/23 17:40:49
@@ -252,30 +252,6 @@ retry:
     }
 }
 
-/* This is a wrapper around fancy_abort, as used in the back end and
-   other front ends.  It will also report the magic number assigned to
-   this particular abort.  That is for backward compatibility with the
-   old C++ abort handler, which would just report the magic number.  */
-void
-friendly_abort (where, file, line, func)
-     int where;
-     const char *file;
-     int line;
-     const char *func;
-{
-  if (errorcount > 0 || sorrycount > 0)
-    /* Say nothing.  */;
-  else if (where > 0)
-    {
-      error ("internal error #%d", where);
-
-      /* Uncount this error, so internal_error will do the right thing.  */
-      --errorcount;
-    }
-
-  fancy_abort (file, line, func);
-}
-
 
 /* Perform appropriate conversions on the initial value of a variable,
    store it in the declaration DECL,



More information about the Gcc-patches mailing list