2004-07-28 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Wed, 28 Jul 2004 15:49:04 +0000 (15:49 +0000)
committerAndrew Cagney <cagney@redhat.com>
Wed, 28 Jul 2004 15:49:04 +0000 (15:49 +0000)
* 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".

gdb/ChangeLog
gdb/ada-lex.l
gdb/c-exp.y
gdb/f-exp.y
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/objc-exp.y
gdb/p-exp.y

index 4a1fcdba2de2dd64e401c6aa41e6ad67ba80c3c8..cd92e08abddcdd0e237c80da98be8b0c5a287209 100644 (file)
@@ -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
index a7ce81639aa735cb43eb76e8e2f298536f30c441..21dba2c021b53ef79db2bd6097d47c98ab364880 100644 (file)
@@ -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)
index 706b4074d88cb77179966b8dc3342c3d53c5ee01..f0c743fca21b6e992c1e53595dbdf85f99345df1 100644 (file)
@@ -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 adff33b4dd3dbb568c1fe889d62296007b514673..5ef65d3bee6b8d1a1b2ac8758f0a4e55aa3b2ee6 100644 (file)
@@ -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 0436719b65480c2daaa443aa551fdd70b1ff48c8..d954bd55aa768ddba5b97e2a1cc203eaa5217464 100644 (file)
@@ -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);
index 6a724071c632ecf7f04c1cbff8d20116839716d2..bc3e5a3f207697ec2d54b55f495c2100cb839756 100644 (file)
@@ -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);
index f56f68d7a07c699a6f5b86b77eea3362d7e3e095..34896c5cd052e3542c99015e7112922648b1f08b 100644 (file)
@@ -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 779424e90d5562f854a526da2f91002ac034c510..a80f8e9275b0263dde58d8c1684414355284db6f 100644 (file)
@@ -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