+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbtypes.h (builtin_type_void): Remove.
+ * gdbtypes.c (builtin_type_void): Remove.
+ (_initialize_gdbtypes): Do not initialize it.
+
+ (safe_parse_type): Add GDBARCH argument. Use it to construct
+ void return type.
+ (check_stub_method): Update call.
+
+ * infcall.c (call_function_by_hand): Use platform-specific type
+ instead of builtin_type_void.
+ * valops.c (value_cast): Use input void type instead of
+ builtin_type_void.
+
2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
* ada-lang.c (assign_component): Use platform-specific integer type
struct type *builtin_type_ia64_spill;
struct type *builtin_type_ia64_quad;
-/* Platform-neutral void type. */
-struct type *builtin_type_void;
-
/* Platform-neutral character types. */
struct type *builtin_type_true_char;
struct type *builtin_type_true_unsigned_char;
}
/* Parse a type expression in the string [P..P+LENGTH). If an error
- occurs, silently return builtin_type_void. */
+ occurs, silently return a void type. */
static struct type *
-safe_parse_type (char *p, int length)
+safe_parse_type (struct gdbarch *gdbarch, char *p, int length)
{
struct ui_file *saved_gdb_stderr;
struct type *type;
/* Call parse_and_eval_type() without fear of longjmp()s. */
if (!gdb_parse_and_eval_type (p, length, &type))
- type = builtin_type_void;
+ type = builtin_type (gdbarch)->builtin_void;
/* Stop suppressing error messages. */
ui_file_delete (gdb_stderr);
static void
check_stub_method (struct type *type, int method_id, int signature_id)
{
+ struct gdbarch *gdbarch = current_gdbarch;
struct fn_field *f;
char *mangled_name = gdb_mangle_name (type, method_id, signature_id);
char *demangled_name = cplus_demangle (mangled_name,
&& strncmp (argtypetext, "void", p - argtypetext) != 0)
{
argtypes[argcount].type =
- safe_parse_type (argtypetext, p - argtypetext);
+ safe_parse_type (gdbarch, argtypetext, p - argtypetext);
argcount += 1;
}
argtypetext = p + 1;
builtin_type_ia64_quad =
build_flt (-1, "builtin_type_ia64_quad", floatformats_ia64_quad);
- builtin_type_void =
- init_type (TYPE_CODE_VOID, 1,
- 0,
- "void", (struct objfile *) NULL);
builtin_type_true_char =
init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0,
extern struct type *builtin_type_ia64_spill;
extern struct type *builtin_type_ia64_quad;
-/* Platform-neutral void type. Never attempt to construct a pointer
- or reference type to this, because those cannot be platform-neutral.
- You must use builtin_type (...)->builtin_void in those cases. */
-extern struct type *builtin_type_void;
/* Platform-neutral character types.
We use these for the '/c' print format, because c_char is just a