This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Eliminate lookup_primitive_typename
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 28 Jul 2004 11:48:30 -0400
- Subject: [commit] Eliminate lookup_primitive_typename
Earlier changes converted it to a simple wrapper to
language_lookup_primitive_type_by_name. This inlines the wrapper.
Andrew
2004-07-28 Andrew Cagney <cagney@gnu.org>
* gdbtypes.c (lookup_primitive_typename): Delete function.
* gdbtypes.h (lookup_primitive_typename): Delete declaration.
* ada-lex.l: Use language_lookup_primitive_type_by_name.
* gdbtypes.c (lookup_typename): Ditto.
* f-exp.y (yylex): Ditto.
* c-exp.y (yylex): Ditto, eliminate assignment in "if".
Index: ada-lex.l
===================================================================
RCS file: /cvs/src/src/gdb/ada-lex.l,v
retrieving revision 1.5
diff -p -u -r1.5 ada-lex.l
--- ada-lex.l 1 Jul 2004 10:11:11 -0000 1.5
+++ ada-lex.l 28 Jul 2004 15:45:04 -0000
@@ -741,7 +741,9 @@ name_lookup (char *name0, char *err_name
if (segments == 0)
{
- type = lookup_primitive_typename (name);
+ type = language_lookup_primitive_type_by_name (current_language,
+ current_gdbarch,
+ name);
if (type == NULL && strcmp ("system__address", name) == 0)
type = builtin_type_ada_system_address;
if (type != NULL)
Index: c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.26
diff -p -u -r1.26 c-exp.y
--- c-exp.y 8 Apr 2004 21:18:12 -0000 1.26
+++ c-exp.y 28 Jul 2004 15:45:04 -0000
@@ -1770,7 +1770,10 @@ yylex ()
yylval.tsym.type = SYMBOL_TYPE (sym);
return TYPENAME;
}
- if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
+ yylval.tsym.type
+ = language_lookup_primitive_type_by_name (current_language,
+ current_gdbarch, tmp);
+ if (yylval.tsym.type != NULL)
return TYPENAME;
/* Input names that aren't symbols but ARE valid hex numbers,
Index: f-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/f-exp.y,v
retrieving revision 1.14
diff -p -u -r1.14 f-exp.y
--- f-exp.y 6 Nov 2003 22:54:01 -0000 1.14
+++ f-exp.y 28 Jul 2004 15:45:04 -0000
@@ -1150,7 +1150,10 @@ yylex ()
yylval.tsym.type = SYMBOL_TYPE (sym);
return TYPENAME;
}
- if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
+ yylval.tsym.type
+ = language_lookup_primitive_type_by_name (current_language,
+ current_gdbarch, tmp);
+ if (yylval.tsym.type != NULL)
return TYPENAME;
/* Input names that aren't symbols but ARE valid hex numbers,
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.87
diff -p -u -r1.87 gdbtypes.c
--- gdbtypes.c 28 Jul 2004 14:32:19 -0000 1.87
+++ gdbtypes.c 28 Jul 2004 15:45:04 -0000
@@ -1030,17 +1030,6 @@ type_name_no_tag (const struct type *typ
return TYPE_NAME (type);
}
-/* Lookup a primitive type named NAME.
- Return zero if NAME is not a primitive type. */
-
-struct type *
-lookup_primitive_typename (char *name)
-{
- return language_lookup_primitive_type_by_name (current_language,
- current_gdbarch,
- name);
-}
-
/* Lookup a typedef or primitive type named NAME,
visible in lexical block BLOCK.
If NOERR is nonzero, return zero if NAME is not suitably defined. */
@@ -1054,7 +1043,9 @@ lookup_typename (char *name, struct bloc
sym = lookup_symbol (name, block, VAR_DOMAIN, 0, (struct symtab **) NULL);
if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF)
{
- tmp = lookup_primitive_typename (name);
+ tmp = language_lookup_primitive_type_by_name (current_language,
+ current_gdbarch,
+ name);
if (tmp)
{
return (tmp);
Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.55
diff -p -u -r1.55 gdbtypes.h
--- gdbtypes.h 28 Jul 2004 14:32:19 -0000 1.55
+++ gdbtypes.h 28 Jul 2004 15:45:04 -0000
@@ -1223,8 +1223,6 @@ extern struct type *check_typedef (struc
extern void check_stub_method_group (struct type *, int);
-extern struct type *lookup_primitive_typename (char *);
-
extern char *gdb_mangle_name (struct type *, int, int);
extern struct type *lookup_typename (char *, struct block *, int);
Index: objc-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/objc-exp.y,v
retrieving revision 1.16
diff -p -u -r1.16 objc-exp.y
--- objc-exp.y 23 Nov 2003 20:41:17 -0000 1.16
+++ objc-exp.y 28 Jul 2004 15:45:04 -0000
@@ -1766,8 +1766,11 @@ yylex ()
#endif /* not 0 */
return TYPENAME;
}
- if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
- return TYPENAME;
+ yylval.tsym.type
+ = language_lookup_primitive_type_by_name (current_language,
+ current_gdbarch, tmp);
+ if (yylval.tsym.type != NULL)
+ return TYPENAME;
/* See if it's an ObjC classname. */
if (!sym)
Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.26
diff -p -u -r1.26 p-exp.y
--- p-exp.y 23 Nov 2003 20:41:17 -0000 1.26
+++ p-exp.y 28 Jul 2004 15:45:04 -0000
@@ -1611,8 +1611,11 @@ yylex ()
#endif /* not 0 */
return TYPENAME;
}
- if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
- return TYPENAME;
+ yylval.tsym.type
+ = language_lookup_primitive_type_by_name (current_language,
+ current_gdbarch, tmp);
+ if (yylval.tsym.type != NULL)
+ return TYPENAME;
/* Input names that aren't symbols but ARE valid hex numbers,
when the input radix permits them, can be names or numbers