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]

Patch: FYI: avoid use of C++ keywords in gcc/java


I'm checking this in on the trunk.

The gcj front end has some variables whose names conflict with C++
keywords.  This patch renames them all.  In my opinion the result is
not any less clear than what is there already.

I am checking this in on the trunk because Kaveh's patch is already
there, and this nicely complements it -- I looked at the gcc-in-cxx
branch but it would be simpler to work there after his patch has been
merged over.

My method was to temporarily put this into a common header:

#pragma GCC poison class typename try catch private public protected explicit namespace export friend operator template this throw typeid typeof using virtual new

That covered all the C++ keywords I thought would be likely to be
used.  So, it is possible I missed an 'int reinterpret_cast;'
somewhere.

This actually catches too many, because we use token pasting where one
token is 'new'.  I would not be averse to renaming these uses if
someone wants to do the work of putting this into system.h.

I bootstrapped and regtested this on x86-64 (compile farm).

Tom

gcc/java/ChangeLog:
2008-06-24  Tom Tromey  <tromey@redhat.com>

	* jcf-path.c (jcf_path_init): Don't name variable 'try'.
	* expr.c (add_type_assertion): Rename argument.
	(build_java_arrayaccess): Don't name variable 'throw'.
	(ARRAY_NEW_MULTI): Don't name variable 'class'.
	* jcf-io.c (find_class): Don't name variable 'class'.
	* mangle.c (compression_table_add): Don't name variable 'new'.
	* constants.c (cpool_for_class): Rename argument.
	(alloc_constant_fieldref): Likewise.
	* jcf-parse.c (handle_innerclass_attribute): Don't name variable
	'class'.
	(read_class): Likewise.
	(parse_zip_file_entries): Likewise.
	(process_zip_dir): Likewise.
	* decl.c (java_mark_class_local): Rename argument.
	* class.c (GEN_TABLE): Use type_name, not typename.
	(gen_indirect_dispatch_tables): Likewise.
	(add_field): Rename argument.
	(is_compiled_class): Likewise.
	(safe_layout_class): Likewise.
	(emit_assertion_table): Likewise.
	* typeck.c (has_method): Rename argument.

Index: gcc/java/typeck.c
===================================================================
--- gcc/java/typeck.c	(revision 137041)
+++ gcc/java/typeck.c	(working copy)
@@ -1,5 +1,5 @@
 /* Handle types for the GNU compiler for the Java(TM) language.
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -691,11 +691,11 @@
 		    method_signature, build_java_signature);
 }
 
-/* Return true iff CLASS (or its ancestors) has a method METHOD_NAME. Â*/
+/* Return true iff KLASS (or its ancestors) has a method METHOD_NAME. Â*/
 int
-has_method (tree class, tree method_name)
+has_method (tree klass, tree method_name)
 {
-  return lookup_do (class, SEARCH_INTERFACE,
+  return lookup_do (klass, SEARCH_INTERFACE,
 		    method_name, NULL_TREE,
 		    build_null_signature) != NULL_TREE;
 }
Index: gcc/java/class.c
===================================================================
--- gcc/java/class.c	(revision 137041)
+++ gcc/java/class.c	(working copy)
@@ -412,11 +412,12 @@
 #define GEN_TABLE(TABLE, NAME, TABLE_TYPE, TYPE)			\
 do									\
 {									\
-  const char *typename = IDENTIFIER_POINTER (mangled_classname ("", TYPE)); \
-  char *buf = (char *) alloca (strlen (typename) + strlen (#NAME "_syms_") + 1); \
+  const char *type_name = IDENTIFIER_POINTER (mangled_classname ("", TYPE)); \
+  char *buf = (char *) alloca (strlen (type_name)			\
+                               + strlen (#NAME "_syms_") + 1);		\
   tree decl;								\
 									\
-  sprintf (buf, #NAME "_%s", typename);					\
+  sprintf (buf, #NAME "_%s", type_name);				\
   TYPE_## TABLE ##_DECL (type) = decl =					\
     build_decl (VAR_DECL, get_identifier (buf), TABLE_TYPE);		\
   DECL_EXTERNAL (decl) = 1;						\
@@ -428,7 +429,7 @@
   pushdecl (decl);							\
   MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl);				\
   DECL_OWNER (decl) = TYPE;						\
-  sprintf (buf, #NAME "_syms_%s", typename);				\
+  sprintf (buf, #NAME "_syms_%s", type_name);				\
   TYPE_## TABLE ##_SYMS_DECL (TYPE) =					\
     build_decl (VAR_DECL, get_identifier (buf), symbols_array_type);	\
   TREE_STATIC (TYPE_## TABLE ##_SYMS_DECL (TYPE)) = 1;			\
@@ -442,13 +443,14 @@
 void
 gen_indirect_dispatch_tables (tree type)
 {
-  const char *typename = IDENTIFIER_POINTER (mangled_classname ("", type));
+  const char *type_name = IDENTIFIER_POINTER (mangled_classname ("", type));
   {  
     tree field = NULL;
-    char *buf = (char *) alloca (strlen (typename) + strlen ("_catch_classes_") + 1);
+    char *buf = (char *) alloca (strlen (type_name)
+				 + strlen ("_catch_classes_") + 1);
     tree catch_class_type = make_node (RECORD_TYPE);
 
-    sprintf (buf, "_catch_classes_%s", typename);
+    sprintf (buf, "_catch_classes_%s", type_name);
     PUSH_FIELD (catch_class_type, field, "address", utf8const_ptr_type);
     PUSH_FIELD (catch_class_type, field, "classname", ptr_type_node);
     FINISH_RECORD (catch_class_type);
@@ -837,14 +839,14 @@
 }
 
 tree
-add_field (tree class, tree name, tree field_type, int flags)
+add_field (tree klass, tree name, tree field_type, int flags)
 {
   int is_static = (flags & ACC_STATIC) != 0;
   tree field;
   field = build_decl (is_static ? VAR_DECL : FIELD_DECL, name, field_type);
-  TREE_CHAIN (field) = TYPE_FIELDS (class);
-  TYPE_FIELDS (class) = field;
-  DECL_CONTEXT (field) = class;
+  TREE_CHAIN (field) = TYPE_FIELDS (klass);
+  TYPE_FIELDS (klass) = field;
+  DECL_CONTEXT (field) = klass;
   MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (field);
 
   if (flags & ACC_PUBLIC) FIELD_PUBLIC (field) = 1;
@@ -871,7 +873,7 @@
 	java_hide_decl (field);
       /* Considered external unless we are compiling it into this
 	 object file.  */
-      DECL_EXTERNAL (field) = (is_compiled_class (class) != 2);
+      DECL_EXTERNAL (field) = (is_compiled_class (klass) != 2);
     }
 
   return field;
@@ -2227,43 +2229,43 @@
   rest_of_decl_compilation (TYPE_NAME (current_class), 1, 0);
 }
 
-/* Return 2 if CLASS is compiled by this compilation job;
-   return 1 if CLASS can otherwise be assumed to be compiled;
-   return 0 if we cannot assume that CLASS is compiled.
+/* Return 2 if KLASS is compiled by this compilation job;
+   return 1 if KLASS can otherwise be assumed to be compiled;
+   return 0 if we cannot assume that KLASS is compiled.
    Returns 1 for primitive and 0 for array types.  */
 int
-is_compiled_class (tree class)
+is_compiled_class (tree klass)
 {
   int seen_in_zip;
-  if (TREE_CODE (class) == POINTER_TYPE)
-    class = TREE_TYPE (class);
-  if (TREE_CODE (class) != RECORD_TYPE)  /* Primitive types are static. */
+  if (TREE_CODE (klass) == POINTER_TYPE)
+    klass = TREE_TYPE (klass);
+  if (TREE_CODE (klass) != RECORD_TYPE)  /* Primitive types are static. */
     return 1;
-  if (TYPE_ARRAY_P (class))
+  if (TYPE_ARRAY_P (klass))
     return 0;
 
-  seen_in_zip = (TYPE_JCF (class) && JCF_SEEN_IN_ZIP (TYPE_JCF (class)));
-  if (CLASS_FROM_CURRENTLY_COMPILED_P (class))
+  seen_in_zip = (TYPE_JCF (klass) && JCF_SEEN_IN_ZIP (TYPE_JCF (klass)));
+  if (CLASS_FROM_CURRENTLY_COMPILED_P (klass))
     {
       /* The class was seen in the current ZIP file and will be
 	 available as a compiled class in the future but may not have
 	 been loaded already. Load it if necessary. This prevent
 	 build_class_ref () from crashing. */
 
-      if (seen_in_zip && !CLASS_LOADED_P (class) && (class != current_class))
-        load_class (class, 1);
+      if (seen_in_zip && !CLASS_LOADED_P (klass) && (klass != current_class))
+        load_class (klass, 1);
 
       /* We return 2 for class seen in ZIP and class from files
          belonging to the same compilation unit */
       return 2;
     }
 
-  if (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class)))))
+  if (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (klass)))))
     {
-      if (!CLASS_LOADED_P (class))
+      if (!CLASS_LOADED_P (klass))
 	{
-	  if (class != current_class)
-	    load_class (class, 1);
+	  if (klass != current_class)
+	    load_class (klass, 1);
 	}
       return 1;
     }
@@ -2382,12 +2384,12 @@
    about the class processed currently.  */
 
 void
-safe_layout_class (tree class)
+safe_layout_class (tree klass)
 {
   tree save_current_class = current_class;
   location_t save_location = input_location;
 
-  layout_class (class);
+  layout_class (klass);
 
   current_class = save_current_class;
   input_location = save_location;
@@ -3010,14 +3012,14 @@
   return true;
 }
 
-/* Generate the type assertion table for CLASS, and return its DECL.  */
+/* Generate the type assertion table for KLASS, and return its DECL.  */
 
 static tree
-emit_assertion_table (tree class)
+emit_assertion_table (tree klass)
 {
   tree null_entry, ctor, table_decl;
   tree list = NULL_TREE;
-  htab_t assertions_htab = TYPE_ASSERTIONS (class);
+  htab_t assertions_htab = TYPE_ASSERTIONS (klass);
 
   /* Iterate through the hash table.  */
   htab_traverse (assertions_htab, add_assertion_table_entry, &list);
@@ -3035,7 +3037,7 @@
   list = nreverse (list);
   ctor = build_constructor_from_list (assertion_table_type, list);
 
-  table_decl = build_decl (VAR_DECL, mangled_classname ("_type_assert_", class),
+  table_decl = build_decl (VAR_DECL, mangled_classname ("_type_assert_", klass),
 			   assertion_table_type);
 
   TREE_STATIC (table_decl) = 1;
Index: gcc/java/decl.c
===================================================================
--- gcc/java/decl.c	(revision 137041)
+++ gcc/java/decl.c	(working copy)
@@ -1899,15 +1899,15 @@
 /* Use the preceding two functions and mark all members of the class.  */
 
 void
-java_mark_class_local (tree class)
+java_mark_class_local (tree klass)
 {
   tree t;
 
-  for (t = TYPE_FIELDS (class); t ; t = TREE_CHAIN (t))
+  for (t = TYPE_FIELDS (klass); t ; t = TREE_CHAIN (t))
     if (FIELD_STATIC (t))
       java_mark_decl_local (t);
 
-  for (t = TYPE_METHODS (class); t ; t = TREE_CHAIN (t))
+  for (t = TYPE_METHODS (klass); t ; t = TREE_CHAIN (t))
     if (!METHOD_ABSTRACT (t))
       {
 	if (METHOD_NATIVE (t) && !flag_jni)
Index: gcc/java/jcf-parse.c
===================================================================
--- gcc/java/jcf-parse.c	(revision 137041)
+++ gcc/java/jcf-parse.c	(working copy)
@@ -1160,8 +1160,8 @@
       /* If icii is 0, don't try to read the class. */
       if (icii >= 0)
 	{
-	  tree class = get_class_constant (jcf, icii);
-	  tree decl = TYPE_NAME (class);
+	  tree klass = get_class_constant (jcf, icii);
+	  tree decl = TYPE_NAME (klass);
           /* Skip reading further if ocii is null */
           if (DECL_P (decl) && !CLASS_COMPLETE_P (decl) && ocii)
 	    {
@@ -1253,7 +1253,7 @@
 read_class (tree name)
 {
   JCF this_jcf, *jcf;
-  tree icv, class = NULL_TREE;
+  tree icv, klass = NULL_TREE;
   tree save_current_class = current_class;
   tree save_output_class = output_class;
   location_t save_location = input_location;
@@ -1261,8 +1261,8 @@
 
   if ((icv = IDENTIFIER_CLASS_VALUE (name)) != NULL_TREE)
     {
-      class = TREE_TYPE (icv);
-      jcf = TYPE_JCF (class);
+      klass = TREE_TYPE (icv);
+      jcf = TYPE_JCF (klass);
     }
   else
     jcf = NULL;
@@ -1284,21 +1284,21 @@
 
   current_jcf = jcf;
 
-  if (class == NULL_TREE || ! CLASS_PARSED_P (class))
+  if (klass == NULL_TREE || ! CLASS_PARSED_P (klass))
     {
-      output_class = current_class = class;
+      output_class = current_class = klass;
       if (JCF_SEEN_IN_ZIP (current_jcf))
 	read_zip_member(current_jcf,
 			current_jcf->zipd, current_jcf->zipd->zipf);
       jcf_parse (current_jcf);
       /* Parsing might change the class, in which case we have to
 	 put it back where we found it.  */
-      if (current_class != class && icv != NULL_TREE)
+      if (current_class != klass && icv != NULL_TREE)
 	TREE_TYPE (icv) = current_class;
-      class = current_class;
+      klass = current_class;
     }
-  layout_class (class);
-  load_inner_classes (class);
+  layout_class (klass);
+  load_inner_classes (klass);
 
   output_class = save_output_class;
   current_class = save_current_class;
@@ -2025,7 +2025,7 @@
   for (i = 0, zdir = (ZipDirectory *)localToFile->central_directory;
        i < localToFile->count; i++, zdir = ZIPDIR_NEXT (zdir))
     {
-      tree class;
+      tree klass;
 
       switch (classify_zip_file (zdir))
 	{
@@ -2036,14 +2036,14 @@
 	  {
 	    char *class_name = compute_class_name (zdir);
 	    int previous_alias_set = -1;
-	    class = lookup_class (get_identifier (class_name));
+	    klass = lookup_class (get_identifier (class_name));
 	    FREE (class_name);
-	    current_jcf = TYPE_JCF (class);
-	    output_class = current_class = class;
+	    current_jcf = TYPE_JCF (klass);
+	    output_class = current_class = klass;
 
 	    /* This is a dummy class, and now we're compiling it for
 	       real.  */
-	    gcc_assert (! TYPE_DUMMY (class));
+	    gcc_assert (! TYPE_DUMMY (klass));
 
 	    /* This is for a corner case where we have a superclass
 	       but no superclass fields.
@@ -2058,17 +2058,17 @@
 	       FIXME: this really is a kludge.  We should figure out a
 	       way to lay out the class properly before this
 	       happens.  */
-	    if (TYPE_SIZE (class) && CLASSTYPE_SUPER (class)
-		&& integer_zerop (TYPE_SIZE (class)))
+	    if (TYPE_SIZE (klass) && CLASSTYPE_SUPER (klass)
+		&& integer_zerop (TYPE_SIZE (klass)))
 	      {
-		TYPE_SIZE (class) = NULL_TREE;
-		previous_alias_set = TYPE_ALIAS_SET (class);
-		TYPE_ALIAS_SET (class) = -1;
+		TYPE_SIZE (klass) = NULL_TREE;
+		previous_alias_set = TYPE_ALIAS_SET (klass);
+		TYPE_ALIAS_SET (klass) = -1;
 	      }
 
-	    if (! CLASS_LOADED_P (class))
+	    if (! CLASS_LOADED_P (klass))
 	      {
-		if (! CLASS_PARSED_P (class))
+		if (! CLASS_PARSED_P (klass))
 		  {
 		    read_zip_member (current_jcf, zdir, localToFile);
 		    jcf_parse (current_jcf);
@@ -2078,7 +2078,7 @@
 	      }
 
 	    if (previous_alias_set != -1)
-	      TYPE_ALIAS_SET (class) = previous_alias_set;
+	      TYPE_ALIAS_SET (klass) = previous_alias_set;
 
 	    if (TYPE_SIZE (current_class) != error_mark_node)
 	      {
@@ -2146,7 +2146,7 @@
        i < localToFile->count; i++, zdir = ZIPDIR_NEXT (zdir))
     {
       char *class_name, *file_name, *class_name_in_zip_dir;
-      tree class;
+      tree klass;
       JCF  *jcf;
 
       class_name_in_zip_dir = ZIPDIR_FILENAME (zdir);
@@ -2163,9 +2163,9 @@
       strncpy (file_name, class_name_in_zip_dir, zdir->filename_length);
       file_name [zdir->filename_length] = '\0';
 
-      class = lookup_class (get_identifier (class_name));
+      klass = lookup_class (get_identifier (class_name));
 
-      if (CLASS_FROM_CURRENTLY_COMPILED_P (class))
+      if (CLASS_FROM_CURRENTLY_COMPILED_P (klass))
 	{
 	  /* We've already compiled this class.  */
 	  duplicate_class_warning (file_name);
@@ -2173,7 +2173,7 @@
 	}
       /* This function is only called when processing a zip file seen
 	 on the command line.  */
-      CLASS_FROM_CURRENTLY_COMPILED_P (class) = 1;
+      CLASS_FROM_CURRENTLY_COMPILED_P (klass) = 1;
 
       jcf->read_state  = finput;
       jcf->filbuf      = jcf_filbuf_from_stdio;
@@ -2181,7 +2181,7 @@
       jcf->filename    = file_name;
       jcf->zipd        = zdir;
 
-      TYPE_JCF (class) = jcf;
+      TYPE_JCF (klass) = jcf;
     }
 }
 
Index: gcc/java/constants.c
===================================================================
--- gcc/java/constants.c	(revision 137041)
+++ gcc/java/constants.c	(working copy)
@@ -1,6 +1,6 @@
 /* Handle the constant pool of the Java(TM) Virtual Machine.
    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-   2007  Free Software Foundation, Inc.
+   2007, 2008  Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -327,14 +327,14 @@
 /* Given a class, return its constant pool, creating one if necessary.  */
 
 CPool *
-cpool_for_class (tree class)
+cpool_for_class (tree klass)
 {
-  CPool *cpool = TYPE_CPOOL (class);
+  CPool *cpool = TYPE_CPOOL (klass);
 
   if (cpool == NULL)
     {
       cpool = GGC_CNEW (struct CPool);
-      TYPE_CPOOL (class) = cpool;
+      TYPE_CPOOL (klass) = cpool;
     }
   return cpool;
 }
@@ -370,13 +370,13 @@
 }
 
 /* Look for a field ref that matches DECL in the constant pool of
-   CLASS.  
+   KLASS.  
    Return the index of the entry.  */
 
 int
-alloc_constant_fieldref (tree class, tree decl)
+alloc_constant_fieldref (tree klass, tree decl)
 {
-  CPool *outgoing_cpool = cpool_for_class (class);
+  CPool *outgoing_cpool = cpool_for_class (klass);
   int class_index 
     = find_tree_constant (outgoing_cpool, CONSTANT_Class, 
 			  DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))));
Index: gcc/java/jcf-path.c
===================================================================
--- gcc/java/jcf-path.c	(revision 137041)
+++ gcc/java/jcf-path.c	(working copy)
@@ -1,6 +1,6 @@
 /* Handle CLASSPATH, -classpath, and path searching.
    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006,
-   2007 Free Software Foundation, Inc.
+   2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -213,7 +213,7 @@
 jcf_path_init (void)
 {
   char *cp;
-  char *try, sep[2];
+  char *attempt, sep[2];
   struct stat stat_b;
   int found = 0, len;
 
@@ -227,56 +227,56 @@
   GET_ENVIRONMENT (cp, "GCC_EXEC_PREFIX");
   if (cp)
     {
-      try = (char *) alloca (strlen (cp) + 50);
+      attempt = (char *) alloca (strlen (cp) + 50);
       /* The exec prefix can be something like
 	 /usr/local/bin/../lib/gcc-lib/.  We want to change this
 	 into a pointer to the share/java directory.  We support two
 	 configurations: one where prefix and exec-prefix are the
 	 same, and one where exec-prefix is `prefix/SOMETHING'.  */
-      strcpy (try, cp);
-      strcat (try, DIR_UP);
-      strcat (try, sep);
-      strcat (try, DIR_UP);
-      strcat (try, sep);
-      len = strlen (try);
+      strcpy (attempt, cp);
+      strcat (attempt, DIR_UP);
+      strcat (attempt, sep);
+      strcat (attempt, DIR_UP);
+      strcat (attempt, sep);
+      len = strlen (attempt);
 
-      strcpy (try + len, "share");
-      strcat (try, sep);
-      strcat (try, "java");
-      strcat (try, sep);
-      strcat (try, "libgcj-" DEFAULT_TARGET_VERSION ".jar");
-      if (! stat (try, &stat_b))
+      strcpy (attempt + len, "share");
+      strcat (attempt, sep);
+      strcat (attempt, "java");
+      strcat (attempt, sep);
+      strcat (attempt, "libgcj-" DEFAULT_TARGET_VERSION ".jar");
+      if (! stat (attempt, &stat_b))
 	{
-	  add_entry (&sys_dirs, try, 1);
+	  add_entry (&sys_dirs, attempt, 1);
 	  found = 1;
-	  strcpy (&try[strlen (try)
-		      - strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")],
+	  strcpy (&attempt[strlen (attempt)
+			   - strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")],
 		  sep);
-	  strcat (try, "ext");
-	  strcat (try, sep);
-	  if (! stat (try, &stat_b))
-	    jcf_path_extdirs_arg (try);
+	  strcat (attempt, "ext");
+	  strcat (attempt, sep);
+	  if (! stat (attempt, &stat_b))
+	    jcf_path_extdirs_arg (attempt);
 	}
       else
 	{
-	  strcpy (try + len, DIR_UP);
-	  strcat (try, sep);
-	  strcat (try, "share");
-	  strcat (try, sep);
-	  strcat (try, "java");
-	  strcat (try, sep);
-	  strcat (try, "libgcj-" DEFAULT_TARGET_VERSION ".jar");
-	  if (! stat (try, &stat_b))
+	  strcpy (attempt + len, DIR_UP);
+	  strcat (attempt, sep);
+	  strcat (attempt, "share");
+	  strcat (attempt, sep);
+	  strcat (attempt, "java");
+	  strcat (attempt, sep);
+	  strcat (attempt, "libgcj-" DEFAULT_TARGET_VERSION ".jar");
+	  if (! stat (attempt, &stat_b))
 	    {
-	      add_entry (&sys_dirs, try, 1);
+	      add_entry (&sys_dirs, attempt, 1);
 	      found = 1;
-	      strcpy (&try[strlen (try)
-			  - strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")],
+	      strcpy (&attempt[strlen (attempt)
+			       - strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")],
 		      sep);
-	      strcat (try, "ext");
-	      strcat (try, sep);
-	      if (! stat (try, &stat_b))
-		jcf_path_extdirs_arg (try);
+	      strcat (attempt, "ext");
+	      strcat (attempt, sep);
+	      if (! stat (attempt, &stat_b))
+		jcf_path_extdirs_arg (attempt);
 	    }
 	}
     }
Index: gcc/java/mangle.c
===================================================================
--- gcc/java/mangle.c	(revision 137041)
+++ gcc/java/mangle.c	(working copy)
@@ -1,6 +1,6 @@
 /* Functions related to mangling class names for the GNU compiler
    for the Java(TM) language.
-   Copyright (C) 1998, 1999, 2001, 2002, 2003, 2006, 2007
+   Copyright (C) 1998, 1999, 2001, 2002, 2003, 2006, 2007, 2008
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -782,13 +782,13 @@
 {
   if (compression_next == TREE_VEC_LENGTH (compression_table))
     {
-      tree new = make_tree_vec (2*compression_next);
+      tree new_table = make_tree_vec (2*compression_next);
       int i;
 
       for (i = 0; i < compression_next; i++)
-	TREE_VEC_ELT (new, i) = TREE_VEC_ELT (compression_table, i);
+	TREE_VEC_ELT (new_table, i) = TREE_VEC_ELT (compression_table, i);
 
-      compression_table = new;
+      compression_table = new_table;
     }
   TREE_VEC_ELT (compression_table, compression_next++) = type;
 }
Index: gcc/java/jcf-io.c
===================================================================
--- gcc/java/jcf-io.c	(revision 137041)
+++ gcc/java/jcf-io.c	(working copy)
@@ -1,6 +1,6 @@
 /* Utility routines for finding and reading Java(TM) .class files.
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005,
-   2006, 2007 Free Software Foundation, Inc.
+   2006, 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -448,7 +448,7 @@
 find_class (const char *classname, int classname_length, JCF *jcf)
 {
   int fd;
-  int i, k, class = -1;
+  int i, k, klass = -1;
   struct stat class_buf;
   char *dep_file;
   void *entry;
@@ -478,7 +478,7 @@
   for (entry = jcf_path_start (); entry != NULL; entry = jcf_path_next (entry))
     {
       const char *path_name = jcf_path_name (entry);
-      if (class != 0)
+      if (klass != 0)
 	{
 	  int dir_len;
 
@@ -521,12 +521,12 @@
 	      else
 		continue;
 	    }
-	  class = caching_stat(buffer, &class_buf);
+	  klass = caching_stat(buffer, &class_buf);
 	}
     }
 
   dep_file = buffer;
-  if (!class)
+  if (!klass)
     {
       SOURCE_FRONTEND_DEBUG ((stderr, "[Class selected: %s]\n",
 			      classname+classname_length-
Index: gcc/java/expr.c
===================================================================
--- gcc/java/expr.c	(revision 137041)
+++ gcc/java/expr.c	(working copy)
@@ -457,20 +457,20 @@
 }
 
 /* Add an entry to the type assertion table for the given class.  
-   CLASS is the class for which this assertion will be evaluated by the 
+   KLASS is the class for which this assertion will be evaluated by the 
    runtime during loading/initialization.
    ASSERTION_CODE is the 'opcode' or type of this assertion: see java-tree.h.
    OP1 and OP2 are the operands. The tree type of these arguments may be
    specific to each assertion_code. */
 
 void
-add_type_assertion (tree class, int assertion_code, tree op1, tree op2)
+add_type_assertion (tree klass, int assertion_code, tree op1, tree op2)
 {
   htab_t assertions_htab;
   type_assertion as;
   void **as_pp;
 
-  assertions_htab = TYPE_ASSERTIONS (class);
+  assertions_htab = TYPE_ASSERTIONS (klass);
   if (assertions_htab == NULL)
     {
       assertions_htab = htab_create_ggc (7, type_assertion_hash, 
@@ -893,7 +893,7 @@
 tree
 build_java_arrayaccess (tree array, tree type, tree index)
 {
-  tree node, throw = NULL_TREE;
+  tree node, throw_expr = NULL_TREE;
   tree data_field;
   tree ref;
   tree array_type = TREE_TYPE (TREE_TYPE (array));
@@ -921,17 +921,18 @@
 			  len);
       if (! integer_zerop (test))
 	{
-	  throw = build2 (TRUTH_ANDIF_EXPR, int_type_node, test,
-			  build_java_throw_out_of_bounds_exception (index));
+	  throw_expr
+	    = build2 (TRUTH_ANDIF_EXPR, int_type_node, test,
+		      build_java_throw_out_of_bounds_exception (index));
 	  /* allows expansion within COMPOUND */
-	  TREE_SIDE_EFFECTS( throw ) = 1;
+	  TREE_SIDE_EFFECTS( throw_expr ) = 1;
 	}
     }
 
   /* If checking bounds, wrap the index expr with a COMPOUND_EXPR in order
      to have the bounds check evaluated first. */
-  if (throw != NULL_TREE)
-    index = build2 (COMPOUND_EXPR, int_type_node, throw, index);
+  if (throw_expr != NULL_TREE)
+    index = build2 (COMPOUND_EXPR, int_type_node, throw_expr, index);
 
   data_field = lookup_field (&array_type, get_identifier ("data"));
 
@@ -3447,9 +3448,9 @@
   }
 #define ARRAY_NEW_MULTI()					\
   {								\
-    tree class = get_class_constant (current_jcf, IMMEDIATE_u2 );	\
+    tree klass = get_class_constant (current_jcf, IMMEDIATE_u2 );	\
     int  ndims = IMMEDIATE_u1;					\
-    expand_java_multianewarray( class, ndims );			\
+    expand_java_multianewarray( klass, ndims );			\
   }
 
 #define UNOP(OPERAND_TYPE, OPERAND_VALUE) \


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