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]
Other format: [Raw text]

[C++ PATCH] Remove some no longer used internal name checks (was Re: Compiling omniORB3 with gcc 3.0.3-pre)


Hi!

On Wed, Dec 12, 2001 at 12:46:12PM +0100, Harri Pasanen wrote:
> I'm again trying to get omniORB3.0.4 working on HP-UX with gcc version 3.0.3 
> 20011212 (prerelease).
> 
> During compilation it spews out zillions of messages like:
> 
> ../omniORB3/NamingDynSK.cc:1123: warning: identifier name `
>    _0RL_insertToAny_Singleton__cCosNaming_mNamingContextExt_mInvalidAddress' 
>    conflicts with GNU C++ internal naming strategy
> 
> ../../../include/omniORB3/Naming.hh:1052: warning: identifier name `_0RL_e' 
>    conflicts with GNU C++ internal naming strategy
> 
> I haven't seen this before, and so I'm wondering if is something that we have 
> to live with gcc 3.0.3?   I'm not sure if there is a way to turn of this 
> specific warning?

This looks like tests for some internal names which aren't used anywhere any
longer (e.g. I don't see ANON_PARMNAME used anywhere even in gcc 2.95.x
(aside from the check above this warning)).
Ok to commit the following patch?
Maybe some more could be deleted too, but the following ones were obviously
unused and nobody would be generating such internal symbols.

2001-12-12  Jakub Jelinek  <jakub@redhat.com>

	* cp-tree.h (DESTRUCTOR_DECL_PREFIX, DESTRUCTOR_NAME_P,
	ANON_PARMNAME_FORMAT, ANON_PARMNAME_P, DESTRUCTOR_NAME_FORMAT,
	THIS_NAME_P): Delete.
	* spew.c (read_process_identifier): Remove DESTRUCTOR_NAME_P,
	THIS_NAME_P and ANON_PARMNAME_P tests from warning about clash
	with internal naming scheme.
	* error.c (dump_decl): Remove DESTRUCTOR_NAME_P use.

--- gcc/cp/cp-tree.h.jj	Wed Dec 12 14:13:24 2001
+++ gcc/cp/cp-tree.h	Wed Dec 12 14:57:34 2001
@@ -3290,7 +3290,6 @@ extern varray_type local_classes;
 
 #define VPTR_NAME "$v"
 #define THROW_NAME "$eh_throw"
-#define DESTRUCTOR_DECL_PREFIX "_$_"
 #define AUTO_VTABLE_NAME "__vtbl$me__"
 #define AUTO_TEMP_NAME "_$tmp_"
 #define AUTO_TEMP_FORMAT "_$tmp_%d"
@@ -3312,7 +3311,6 @@ extern varray_type local_classes;
 
 #define VPTR_NAME ".v"
 #define THROW_NAME ".eh_throw"
-#define DESTRUCTOR_DECL_PREFIX "_._"
 #define AUTO_VTABLE_NAME "__vtbl.me__"
 #define AUTO_TEMP_NAME "_.tmp_"
 #define AUTO_TEMP_FORMAT "_.tmp_%d"
@@ -3333,10 +3331,6 @@ extern varray_type local_classes;
 #define VPTR_NAME_P(ID_NODE) \
   (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1))
 #define THROW_NAME "__eh_throw"
-#define DESTRUCTOR_DECL_PREFIX "__destr_"
-#define DESTRUCTOR_NAME_P(ID_NODE) \
-  (!strncmp (IDENTIFIER_POINTER (ID_NODE), DESTRUCTOR_DECL_PREFIX, \
-	     sizeof (DESTRUCTOR_DECL_PREFIX) - 1))
 #define IN_CHARGE_NAME "__in_chrg"
 #define AUTO_VTABLE_NAME "__vtbl_me__"
 #define AUTO_TEMP_NAME "__tmp_"
@@ -3368,16 +3362,11 @@ extern varray_type local_classes;
   (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \
 	     sizeof (ANON_AGGRNAME_PREFIX) - 1))
 #define ANON_AGGRNAME_FORMAT "__anon_%d"
-#define ANON_PARMNAME_FORMAT "__%d"
-#define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
-				  && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \
-				  && IDENTIFIER_POINTER (ID_NODE)[2] <= '9')
 
 #endif	/* NO_DOT_IN_LABEL */
 #endif	/* NO_DOLLAR_IN_LABEL */
 
 #define THIS_NAME "this"
-#define DESTRUCTOR_NAME_FORMAT "~%s"
 #define FILE_FUNCTION_PREFIX_LEN 9
 #define CTOR_NAME "__ct"
 #define DTOR_NAME "__dt"
@@ -3401,14 +3390,10 @@ extern varray_type local_classes;
 
 #define CTOR_VTBL_NAME_PREFIX "__ctorvt_"
 
-#define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0)
-
 #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
 
 #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
 			      && IDENTIFIER_POINTER (ID_NODE)[1] == 'v')
-#define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER \
-                                    && IDENTIFIER_POINTER (ID_NODE)[2] == '_')
 
 #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
   && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
@@ -3426,9 +3411,6 @@ extern varray_type local_classes;
    not be harmful if it does.  */
 #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
 				  && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
-#define ANON_PARMNAME_FORMAT "_%d"
-#define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
-				  && IDENTIFIER_POINTER (ID_NODE)[1] <= '9')
 #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
 
 /* Store the vbase pointer field name for type TYPE into pointer BUF.  */
--- gcc/cp/spew.c.jj	Sat Aug  4 22:26:18 2001
+++ gcc/cp/spew.c	Wed Dec 12 14:56:28 2001
@@ -238,13 +238,10 @@ read_process_identifier (pyylval)
      the user's namespace, but is if '$' or double underscores are.  */
 
 #if !defined(JOINER) || JOINER == '$'
-  if (THIS_NAME_P (id)
-      || VPTR_NAME_P (id)
-      || DESTRUCTOR_NAME_P (id)
+  if (VPTR_NAME_P (id)
       || VTABLE_NAME_P (id)
       || TEMP_NAME_P (id)
-      || ANON_AGGRNAME_P (id)
-      || ANON_PARMNAME_P (id))
+      || ANON_AGGRNAME_P (id))
      warning (
 "identifier name `%s' conflicts with GNU C++ internal naming strategy",
 	      IDENTIFIER_POINTER (id));
--- gcc/cp/error.c.jj	Mon Oct  1 17:02:24 2001
+++ gcc/cp/error.c	Wed Dec 12 14:54:36 2001
@@ -1005,24 +1005,15 @@ dump_decl (t, flags)
       /* These special cases are duplicated here so that other functions
 	 can feed identifiers to cp_error and get them demangled properly.  */
     case IDENTIFIER_NODE:
-      { tree f;
-	if (DESTRUCTOR_NAME_P (t)
-	    && (f = ident_fndecl (t))
-	    && DECL_LANGUAGE (f) == lang_cplusplus)
-	  {
-	    output_add_character (scratch_buffer, '~');
-	    dump_decl (DECL_NAME (f), flags);
-	  }
-	else if (IDENTIFIER_TYPENAME_P (t))
-	  {
-	    output_add_string (scratch_buffer, "operator ");
-	    /* Not exactly IDENTIFIER_TYPE_VALUE.  */
-	    dump_type (TREE_TYPE (t), flags);
-	    break;
-	  }
-	else
-	  print_tree_identifier (scratch_buffer, t);
-      }
+      if (IDENTIFIER_TYPENAME_P (t))
+	{
+	  output_add_string (scratch_buffer, "operator ");
+	  /* Not exactly IDENTIFIER_TYPE_VALUE.  */
+	  dump_type (TREE_TYPE (t), flags);
+	  break;
+	}
+      else
+	print_tree_identifier (scratch_buffer, t);
       break;
 
     case OVERLOAD:


	Jakub


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