This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Avoid C++ keywords in gengtype
- From: Thomas Neumann <tneumann at users dot sourceforge dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Apr 2007 22:34:22 +0200
- Subject: Avoid C++ keywords in gengtype
Hi,
I attached a patch to remove the C++ keyword typename as variable name.
In fact this makes the code more consists, as note_def_vec_alloc already
used "type" instead of "typename".
Perhaps someone can apply it, as the GCC Coding Conventions recommend
avoiding C++ keywords. The code was boostrapped on x86_64.
I hope it is ok to post patches like these, I currently try to build gcc
using a C++ compiler. I continue this with a low intensity (waiting for
boostrap most of the time), but it might produce a lot of tiny patches
that someone else has to apply.
Thomas
* gengtype.c: Use type instead of typename to avoid a C++ keyword.
* gengtype.h: Likewise.
Index: gcc/gengtype.c
===================================================================
--- gcc/gengtype.c (revision 123722)
+++ gcc/gengtype.c (working copy)
@@ -3427,22 +3427,22 @@ write_roots (pair_p variables)
where the GTY(()) tags are only present if is_scalar is _false_. */
void
-note_def_vec (const char *typename, bool is_scalar, struct fileloc *pos)
+note_def_vec (const char *type, bool is_scalar, struct fileloc *pos)
{
pair_p fields;
type_p t;
options_p o;
type_p len_ty = create_scalar_type ("unsigned");
- const char *name = concat ("VEC_", typename, "_base", (char *)0);
+ const char *name = concat ("VEC_", type, "_base", (char *)0);
if (is_scalar)
{
- t = create_scalar_type (typename);
+ t = create_scalar_type (type);
o = 0;
}
else
{
- t = resolve_typedef (typename, pos);
+ t = resolve_typedef (type, pos);
o = create_option (0, "length", "%h.num");
}
Index: gcc/gengtype.h
===================================================================
--- gcc/gengtype.h (revision 123722)
+++ gcc/gengtype.h (working copy)
@@ -64,7 +64,7 @@ extern pair_p nreverse_pairs (pair_p lis
extern type_p adjust_field_type (type_p, options_p);
extern void note_variable (const char *s, type_p t, options_p o,
struct fileloc *pos);
-extern void note_def_vec (const char *typename, bool is_scalar,
+extern void note_def_vec (const char *type, bool is_scalar,
struct fileloc *pos);
extern void note_def_vec_alloc (const char *type, const char *astrat,
struct fileloc *pos);