2004-07-27 Andrew Cagney <cagney@gnu.org>
* defs.h (enum language): Add nr_languages. * language.h (struct language_arch_info): Define. (struct language_defn): Add la_language_arch_info. (language_lookup_primative_type_by_name): Declare. (language_string_char_type): Declare. * language.c (_initialize_language, language_gdbarch_post_init) (struct language_gdbarch, language_gdbarch_data): Implement per-architecture language information. (unknown_language_arch_info, language_string_char_type) (language_lookup_primative_type_by_name): New functions. (unknown_language_defn, auto_language_defn) (local_language_defn): Set la_language_arch_info to unknown_language_arch_info. (unknown_builtin_types): Delete. * gdbtypes.c (lookup_primitive_typename): Use language_lookup_primative_type_by_name. (create_string_type): Use language_string_char_type. * values.c (value_from_string): Use language_string_char_type. * scm-lang.c (scm_language_defn): Add NULL la_language_arch_info. * p-lang.c (pascal_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * jv-lang.c (java_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * f-lang.c (f_language_defn): Ditto. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Ditto.
This commit is contained in:
parent
000177f0ad
commit
f290d38e06
13 changed files with 175 additions and 30 deletions
|
@ -774,8 +774,12 @@ create_array_type (struct type *result_type, struct type *element_type,
|
|||
struct type *
|
||||
create_string_type (struct type *result_type, struct type *range_type)
|
||||
{
|
||||
struct type *string_char_type;
|
||||
|
||||
string_char_type = language_string_char_type (current_language,
|
||||
current_gdbarch);
|
||||
result_type = create_array_type (result_type,
|
||||
*current_language->string_char_type,
|
||||
string_char_type,
|
||||
range_type);
|
||||
TYPE_CODE (result_type) = TYPE_CODE_STRING;
|
||||
return (result_type);
|
||||
|
@ -1032,16 +1036,9 @@ type_name_no_tag (const struct type *type)
|
|||
struct type *
|
||||
lookup_primitive_typename (char *name)
|
||||
{
|
||||
struct type **const *p;
|
||||
|
||||
for (p = current_language->la_builtin_type_vector; *p != NULL; p++)
|
||||
{
|
||||
if (strcmp (TYPE_NAME (**p), name) == 0)
|
||||
{
|
||||
return (**p);
|
||||
}
|
||||
}
|
||||
return (NULL);
|
||||
return language_lookup_primative_type_by_name (current_language,
|
||||
current_gdbarch,
|
||||
name);
|
||||
}
|
||||
|
||||
/* Lookup a typedef or primitive type named NAME,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue