aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-07-28 15:49:04 +0000
committerAndrew Cagney <cagney@redhat.com>2004-07-28 15:49:04 +0000
commit54a5b07d668e9320efb1ada27582f859ccfaaaf3 (patch)
treebb8806432915e2a3c51e5fce41748971395d232f /gdb
parente9667a656bea31ff7d801cf8a7699f0f006319a1 (diff)
downloadgdb-54a5b07d668e9320efb1ada27582f859ccfaaaf3.zip
gdb-54a5b07d668e9320efb1ada27582f859ccfaaaf3.tar.gz
gdb-54a5b07d668e9320efb1ada27582f859ccfaaaf3.tar.bz2
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".
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/ada-lex.l4
-rw-r--r--gdb/c-exp.y5
-rw-r--r--gdb/f-exp.y5
-rw-r--r--gdb/gdbtypes.c15
-rw-r--r--gdb/gdbtypes.h2
-rw-r--r--gdb/objc-exp.y7
-rw-r--r--gdb/p-exp.y7
8 files changed, 31 insertions, 21 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4a1fcdb..cd92e08 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
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".
+
* scm-lang.c (c_builtin_types): Delete extern declaration.
(scm_language_defn): Replace
string_char_type and primitive_type_vector with
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index a7ce816..21dba2c 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -741,7 +741,9 @@ name_lookup (char *name0, char *err_name, int *token_type, int depth)
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)
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 706b407..f0c743f 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -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,
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index adff33b..5ef65d3 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -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,
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 0436719..d954bd5 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1030,17 +1030,6 @@ type_name_no_tag (const struct type *type)
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 block *block, int noerr)
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);
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 6a72407..bc3e5a3 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1223,8 +1223,6 @@ extern struct type *check_typedef (struct type *);
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);
diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y
index f56f68d..34896c5 100644
--- a/gdb/objc-exp.y
+++ b/gdb/objc-exp.y
@@ -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)
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 779424e..a80f8e9 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -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