This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] builtin #4ofN convert other c_builtin_type clients
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 28 Jul 2004 11:19:33 -0400
- Subject: [commit] builtin #4ofN convert other c_builtin_type clients
Hello,
This goes through all the other lanugages that are using C's "builtin"
types and converts them to c_language_arch_info.
committed,
Andrew
2004-07-28 Andrew Cagney <cagney@gnu.org>
* scm-lang.c (c_builtin_types): Delete extern declaration.
(scm_language_defn): Replace
string_char_type and primitive_type_vector with
la_language_arch_info.
* jv-lang.c (java_language_defn): Replace
string_char_type and primitive_type_vector with
la_language_arch_info.
* config/i386/i386sco4.mh (NATDEPFILES): Remove reference to
c_builtin_types in comment.
* c-lang.h (struct language_arch_info): Declare opaque.
(c_language_arch_info): Declare.
(c_builtin_types): Delete declaration.
* c-lang.c (c_language_arch_info): Set string_char_type to
builtin_char, not builtin_true_char. Make global.
(c_builtin_types): Delete array.
(asm_language_defn, minimal_language_defn): Replace
string_char_type and primitive_type_vector with
la_language_arch_info.
Index: c-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.c,v
retrieving revision 1.30
diff -p -u -r1.30 c-lang.c
--- c-lang.c 28 Jul 2004 14:32:19 -0000 1.30
+++ c-lang.c 28 Jul 2004 15:16:27 -0000
@@ -513,28 +513,6 @@ const struct op_print c_op_print_tab[] =
{NULL, 0, 0, 0}
};
-struct type **const (c_builtin_types[]) =
-{
- &builtin_type_int,
- &builtin_type_long,
- &builtin_type_short,
- &builtin_type_char,
- &builtin_type_float,
- &builtin_type_double,
- &builtin_type_void,
- &builtin_type_long_long,
- &builtin_type_signed_char,
- &builtin_type_unsigned_char,
- &builtin_type_unsigned_short,
- &builtin_type_unsigned_int,
- &builtin_type_unsigned_long,
- &builtin_type_unsigned_long_long,
- &builtin_type_long_double,
- &builtin_type_complex,
- &builtin_type_double_complex,
- 0
-};
-
enum c_primitive_types {
c_primitive_type_int,
c_primitive_type_long,
@@ -556,12 +534,12 @@ enum c_primitive_types {
nr_c_primitive_types
};
-static void
+void
c_language_arch_info (struct gdbarch *gdbarch,
struct language_arch_info *lai)
{
const struct builtin_type *builtin = builtin_type (gdbarch);
- lai->string_char_type = builtin->builtin_true_char;
+ lai->string_char_type = builtin->builtin_char;
lai->primitive_type_vector
= GDBARCH_OBSTACK_CALLOC (gdbarch, nr_c_primitive_types + 1,
struct type *);
@@ -687,7 +665,7 @@ const struct language_defn asm_language_
{
"asm", /* Language name */
language_asm,
- c_builtin_types,
+ NULL,
range_check_off,
type_check_off,
case_sensitive_on,
@@ -715,9 +693,9 @@ const struct language_defn asm_language_
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
- &builtin_type_char, /* Type of string elements */
+ NULL,
default_word_break_characters,
- NULL, /* FIXME: la_language_arch_info. */
+ c_language_arch_info, /* FIXME: la_language_arch_info. */
LANG_MAGIC
};
@@ -730,7 +708,7 @@ const struct language_defn minimal_langu
{
"minimal", /* Language name */
language_minimal,
- c_builtin_types,
+ NULL,
range_check_off,
type_check_off,
case_sensitive_on,
@@ -758,9 +736,9 @@ const struct language_defn minimal_langu
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
- &builtin_type_char, /* Type of string elements */
+ NULL,
default_word_break_characters,
- NULL, /* FIXME: la_language_arch_info. */
+ c_language_arch_info,
LANG_MAGIC
};
Index: c-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.h,v
retrieving revision 1.7
diff -p -u -r1.7 c-lang.h
--- c-lang.h 12 Apr 2003 17:41:25 -0000 1.7
+++ c-lang.h 28 Jul 2004 15:16:27 -0000
@@ -24,6 +24,7 @@
#define C_LANG_H 1
struct ui_file;
+struct language_arch_info;
#include "value.h"
#include "macroexp.h"
@@ -61,7 +62,8 @@ extern void *expression_macro_lookup_bat
extern struct type *c_create_fundamental_type (struct objfile *, int);
-extern struct type **const (c_builtin_types[]);
+extern void c_language_arch_info (struct gdbarch *gdbarch,
+ struct language_arch_info *lai);
/* These are in c-typeprint.c: */
Index: jv-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-lang.c,v
retrieving revision 1.32
diff -p -u -r1.32 jv-lang.c
--- jv-lang.c 28 Jul 2004 02:46:23 -0000 1.32
+++ jv-lang.c 28 Jul 2004 15:16:27 -0000
@@ -1084,7 +1084,7 @@ const struct language_defn java_language
{
"java", /* Language name */
language_java,
- c_builtin_types,
+ NULL,
range_check_off,
type_check_off,
case_sensitive_on,
@@ -1112,9 +1112,9 @@ const struct language_defn java_language
java_op_print_tab, /* expression operators for printing */
0, /* not c-style arrays */
0, /* String lower bound */
- &builtin_type_char, /* Type of string elements */
+ NULL,
default_word_break_characters,
- NULL, /* FIXME: la_language_arch_info. */
+ c_language_arch_info,
LANG_MAGIC
};
Index: scm-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/scm-lang.c,v
retrieving revision 1.25
diff -p -u -r1.25 scm-lang.c
--- scm-lang.c 28 Jul 2004 02:46:24 -0000 1.25
+++ scm-lang.c 28 Jul 2004 15:16:27 -0000
@@ -44,8 +44,6 @@ static void scm_printstr (struct ui_file
unsigned int length, int width,
int force_ellipses);
-extern struct type **const (c_builtin_types[]);
-
struct type *builtin_type_scm;
void
@@ -246,7 +244,7 @@ const struct language_defn scm_language_
{
"scheme", /* Language name */
language_scm,
- c_builtin_types,
+ NULL,
range_check_off,
type_check_off,
case_sensitive_off,
@@ -274,9 +272,9 @@ const struct language_defn scm_language_
NULL, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
- &builtin_type_char, /* Type of string elements */
+ NULL,
default_word_break_characters,
- NULL, /* FIXME: la_language_arch_info. */
+ c_language_arch_info,
LANG_MAGIC
};
Index: config/i386/i386sco4.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386sco4.mh,v
retrieving revision 1.2
diff -p -u -r1.2 i386sco4.mh
--- config/i386/i386sco4.mh 18 Jan 2002 04:50:59 -0000 1.2
+++ config/i386/i386sco4.mh 28 Jul 2004 15:16:27 -0000
@@ -7,5 +7,5 @@ NAT_FILE= nm-i386sco4.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o i386v-nat.o
# The cc compiler mishandles const in cases like
-# struct type ** const (c_builtin_types[]) =
+# struct type ** const (array[]) =
MH_CFLAGS=-Dconst=