/* Header file for GDB compile command and supporting functions.
- Copyright (C) 2014-2018 Free Software Foundation, Inc.
+ Copyright (C) 2014-2019 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
struct block;
+/* An object that maps a gdb type to a gcc type. */
+
+struct type_map_instance
+{
+ /* The gdb type. */
+
+ struct type *type;
+
+ /* The corresponding gcc type handle. */
+
+ gcc_type gcc_type_handle;
+};
+
/* An object of this type holds state associated with a given
compilation job. */
virtual ~compile_instance ()
{
m_gcc_fe->ops->destroy (m_gcc_fe);
- htab_delete (m_type_map);
- if (m_symbol_err_map != NULL)
- htab_delete (m_symbol_err_map);
}
/* Returns the GCC options to be passed during compilation. */
/* Query the type cache for TYPE, returning the compiler's
type for it in RET. */
- bool get_cached_type (struct type *type, gcc_type &ret) const;
+ bool get_cached_type (struct type *type, gcc_type *ret) const;
/* Insert GCC_TYPE into the type cache for TYPE.
std::string m_gcc_target_options;
/* Map from gdb types to gcc types. */
- htab_t m_type_map;
+ htab_up m_type_map;
/* Map from gdb symbols to gcc error messages to emit. */
- htab_t m_symbol_err_map;
+ htab_up m_symbol_err_map;
};
/* Define header and footers for different scopes. */
#define COMPILE_I_EXPR_VAL "__gdb_expr_val"
#define COMPILE_I_EXPR_PTR_TYPE "__gdb_expr_ptr_type"
+/* A "type" to indicate a NULL type. */
+
+const gcc_type GCC_TYPE_NONE = (gcc_type) -1;
+
/* Call gdbarch_register_name (GDBARCH, REGNUM) and convert its result
to a form suitable for the compiler source. The register names
should not clash with inferior defined macros. */