]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
More patch separation cleanups.
authorKeith Seitz <keiths@redhat.com>
Thu, 9 Feb 2017 23:02:03 +0000 (15:02 -0800)
committerKeith Seitz <keiths@redhat.com>
Mon, 20 Feb 2017 20:23:22 +0000 (12:23 -0800)
49 files changed:
gdb/c-lang.c
gdb/c-lang.h
gdb/c-typeprint.c
gdb/compile/compile-c-support.c
gdb/compile/compile-c-symbols.c
gdb/compile/compile-c-types.c
gdb/compile/compile-c.h
gdb/compile/compile-cplus-templates.c
gdb/compile/compile-cplus-types.c
gdb/compile/compile-cplus.h
gdb/compile/compile-internal.h
gdb/compile/compile.c
gdb/cp-abi.h
gdb/cp-support.c
gdb/cp-support.h
gdb/dwarf2read.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/gnu-v2-abi.c
gdb/gnu-v3-abi.c
gdb/language.h
gdb/linespec.c
gdb/symtab.h
gdb/testsuite/gdb.compile/compile-cplus-print.exp
gdb/testsuite/gdb.compile/compile-cplus.c
gdb/testsuite/gdb.compile/compile-cplus.exp
gdb/testsuite/gdb.compile/compile-ifunc.exp
gdb/testsuite/gdb.compile/compile-ops.exp
gdb/testsuite/gdb.compile/compile-print.exp
gdb/testsuite/gdb.compile/compile-setjmp.exp
gdb/testsuite/gdb.compile/compile-tls.exp
gdb/testsuite/gdb.compile/compile.exp
gdb/testsuite/gdb.compile/cp-namespace-template.cc
gdb/testsuite/gdb.compile/cp-namespace-template.exp
gdb/testsuite/gdb.compile/cp-simple-anonymous.exp
gdb/testsuite/gdb.compile/cp-simple-inherit.exp
gdb/testsuite/gdb.compile/cp-simple-member.exp
gdb/testsuite/gdb.compile/cp-simple-method.exp
gdb/testsuite/gdb.compile/cp-simple-nested.cc
gdb/testsuite/gdb.compile/cp-simple-nested.exp
gdb/testsuite/gdb.compile/cp-simple-ns.cc
gdb/testsuite/gdb.compile/cp-simple-ns.exp
gdb/testsuite/gdb.compile/cp-simple-template.cc
gdb/testsuite/gdb.compile/cp-simple-template.exp
gdb/testsuite/gdb.compile/cp-simple-virtual.cc
gdb/testsuite/gdb.compile/cp-simple-virtual.exp
gdb/testsuite/gdb.compile/cp-special-function.exp
gdb/testsuite/lib/compile-support.exp [moved from gdb/testsuite/lib/compiler-support.exp with 100% similarity]
gdb/valops.c

index b82b7bf19ed14909f088b7b0f3586ff001c7b29a..1d69338f5aacbb9a01ce273bc15f4f770fd51568 100644 (file)
@@ -729,16 +729,15 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
 static unsigned int
 cplus_compute_string_hash (const char *string0)
 {
-  const char *p, *last_scope;
-
   /* If '<' doesn't appear at all in STRING), there is no way we could
      be dealing with a template name.  */
   if (find_toplevel_char (string0, '<') == NULL)
     return default_compute_string_hash (string0);
 
   /* Locate the last qualified component of STRING0.  */
-  p = find_toplevel_string (string0, "::");
-  last_scope = NULL;
+  const char *p = find_toplevel_string (string0, "::");
+  const char *last_scope = NULL;
+
   while (p != NULL)
     {
       last_scope = p;
@@ -758,7 +757,7 @@ cplus_compute_string_hash (const char *string0)
      and not be a template at all.  */
   if ((p - last_scope) > 8 && strncmp (p - 8, "operator", 8) == 0)
     {
-      /* Skip <,=  */
+      /* Skip <,=.  */
       while (strchr ("<=", *p) != NULL)
        ++p;
 
@@ -770,19 +769,13 @@ cplus_compute_string_hash (const char *string0)
      a template function itself.  */
   if (p == NULL)
     return default_compute_string_hash (string0);
-  else
-    {
-      unsigned int hash;
-      char *copy = ASTRDUP (string0);
 
-      copy[p - string0] = '\0';
+  char *copy = ASTRDUP (string0);
 
-      /* It *is a template, compute the hash based only until P.  */
-      hash = default_compute_string_hash (copy);
-      /* !!keiths: Probably should snarf dict_hash/minsym_hash_iw
-        and do this by length.  What about cp_entire_prefix_len?  */
-      return hash;
-    }
+  copy[p - string0] = '\0';
+
+  /* It is a template, compute the hash based only until P.  */
+  return default_compute_string_hash (copy);
 }
 
 \f
index 508a5461f2f41572e7da2b3eb01c0f79fc98c246..6fdcaa4f90b2b180f8eb538342b94f9940a360e3 100644 (file)
@@ -150,7 +150,7 @@ extern int c_textual_element_type (struct type *, char);
    exception on failure.  This is suitable for use as the
    la_get_compile_instance language method.  */
 
-extern struct compile_instance *c_get_compile_context (void);
+extern compile::compile_instance *c_get_compile_context (void);
 
 /* Create a new instance of the C++ compiler and return it.  The new
    compiler is owned by the caller and must be freed using the destroy
@@ -158,7 +158,7 @@ extern struct compile_instance *c_get_compile_context (void);
    exception on failure.  This is suitable for use as the
    la_get_compile_instance language method.  */
 
-extern struct compile_instance *cplus_get_compile_context (void);
+extern compile::compile_instance *cplus_get_compile_context (void);
 
 /* This takes the user-supplied text and returns a new bit of code to
    compile.
@@ -166,7 +166,7 @@ extern struct compile_instance *cplus_get_compile_context (void);
    This is used as the la_compute_program language method; see that
    for a description of the arguments.  */
 
-extern std::string c_compute_program (struct compile_instance *inst,
+extern std::string c_compute_program (compile::compile_instance *inst,
                                      const char *input,
                                      struct gdbarch *gdbarch,
                                      const struct block *expr_block,
@@ -177,7 +177,7 @@ extern std::string c_compute_program (struct compile_instance *inst,
    This is used as the la_compute_program language method; see that
    for a description of the arguments.  */
 
-extern std::string cplus_compute_program (struct compile_instance *inst,
+extern std::string cplus_compute_program (compile::compile_instance *inst,
                                          const char *input,
                                          struct gdbarch *gdbarch,
                                          const struct block *expr_block,
index f2042f940aea117b0966767a55911f5dcf54ff93..5c8e0a024ef69c99eddc7140c9114f42eea98914 100644 (file)
@@ -1164,9 +1164,9 @@ c_type_print_base (struct type *type, struct ui_file *stream,
                    || is_destructor_name (physname)
                    || method_name[0] == '~';
 
-                 /* Do not print out artificial or "duplicate" methods.  */
+                 /* Do not print out artificial or alias methods.  */
                  if (TYPE_FN_FIELD_ARTIFICIAL (f, j)
-                     || TYPE_FN_FIELD_DUPLICATE (f, j))
+                     || TYPE_FN_FIELD_ALIAS (f, j))
                    continue;
 
                  inner_cleanup = make_cleanup (null_cleanup, NULL);
index e823d3d7b58d2825a4f71e132be4f8c42224b161..02421f054d59ae184be0c3ef0dd6b3dac2f0c4ad 100644 (file)
@@ -95,7 +95,7 @@ load_libcompile (const char *fe_libcc, const char *fe_context)
 
 template <typename INSTTYPE, typename FUNCTYPE, typename CTXTYPE,
          typename BASE_VERSION_TYPE, typename API_VERSION_TYPE>
-struct compile_instance *
+compile::compile_instance *
 get_compile_context (const char *fe_libcc, const char *fe_context,
                     BASE_VERSION_TYPE base_version,
                     API_VERSION_TYPE api_version)
@@ -119,9 +119,11 @@ get_compile_context (const char *fe_libcc, const char *fe_context,
 
 /* A C-language implementation of get_compile_context.  */
 
-struct compile_instance *
+compile::compile_instance *
 c_get_compile_context (void)
 {
+  using namespace compile;
+
   return get_compile_context
     <compile_c_instance, gcc_c_fe_context_function, gcc_c_context,
     gcc_base_api_version, gcc_c_api_version>
@@ -131,7 +133,7 @@ c_get_compile_context (void)
 
 /* A C++-language implementation of get_compile_context.  */
 
-struct compile_instance *
+compile::compile_instance *
 cplus_get_compile_context (void)
 {
   using namespace compile;
@@ -199,7 +201,6 @@ write_macro_definitions (const struct block *block, CORE_ADDR pc,
     macro_for_each_in_scope (scope->file, scope->line, print_one_macro, file);
 }
 
-
 /* Generate a structure holding all the registers used by the function
    we're generating.  */
 
@@ -207,13 +208,14 @@ static void
 generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
                          const unsigned char *registers_used)
 {
+  int i;
   int seen = 0;
 
   fputs_unfiltered ("struct " COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG " {\n",
                    stream);
 
   if (registers_used != NULL)
-    for (int i = 0; i < gdbarch_num_regs (gdbarch); ++i)
+    for (i = 0; i < gdbarch_num_regs (gdbarch); ++i)
       {
        if (registers_used[i])
          {
@@ -648,7 +650,7 @@ private:
 
 /* The types used for C and C++ program computations.  */
 
-typedef compile_program<compile_c_instance, c_push_user_expression,
+typedef compile_program<compile::compile_c_instance, c_push_user_expression,
                        pop_user_expression_nop, c_add_code_header,
                        c_add_code_footer,
                        c_add_input> c_compile_program;
@@ -661,12 +663,14 @@ typedef compile_program<compile::compile_cplus_instance,
 /* The la_compute_program method for C.  */
 
 std::string
-c_compute_program (struct compile_instance *inst,
+c_compute_program (compile::compile_instance *inst,
                   const char *input,
                   struct gdbarch *gdbarch,
                   const struct block *expr_block,
                   CORE_ADDR expr_pc)
 {
+  using namespace compile;
+
   compile_c_instance *c_inst = static_cast<compile_c_instance *> (inst);
   c_compile_program program (c_inst, gdbarch);
 
@@ -676,7 +680,7 @@ c_compute_program (struct compile_instance *inst,
 /* The la_compute_program method for C++.  */
 
 std::string
-cplus_compute_program (struct compile_instance *inst,
+cplus_compute_program (compile::compile_instance *inst,
                       const char *input,
                       struct gdbarch *gdbarch,
                       const struct block *expr_block,
index 9c0a918c89ec4f1e73d495b299eb82bb91e144d2..e5023af7281dc703a3ab60fc84576c4873e444cd 100644 (file)
@@ -33,6 +33,8 @@
 
 \f
 
+using namespace compile;
+
 /* See description in compile-c.h.  */
 
 char *
@@ -49,7 +51,7 @@ c_symbol_substitution_name (struct symbol *sym)
    scope.)  */
 
 static void
-convert_one_symbol (struct compile_c_instance *context,
+convert_one_symbol (compile_c_instance *context,
                    struct block_symbol sym,
                    int is_global,
                    int is_local)
@@ -209,7 +211,7 @@ convert_one_symbol (struct compile_c_instance *context,
    itself, and DOMAIN is the domain which was searched.  */
 
 static void
-convert_symbol_sym (struct compile_c_instance *context, const char *identifier,
+convert_symbol_sym (compile_c_instance *context, const char *identifier,
                    struct block_symbol sym, domain_enum domain)
 {
   const struct block *static_block;
@@ -259,7 +261,7 @@ convert_symbol_sym (struct compile_c_instance *context, const char *identifier,
    to use and BMSYM is the minimal symbol to convert.  */
 
 static void
-convert_symbol_bmsym (struct compile_c_instance *context,
+convert_symbol_bmsym (compile_c_instance *context,
                      struct bound_minimal_symbol bmsym)
 {
   struct minimal_symbol *msym = bmsym.minsym;
@@ -323,7 +325,7 @@ gcc_convert_symbol (void *datum,
                    enum gcc_c_oracle_request request,
                    const char *identifier)
 {
-  struct compile_c_instance *context = (struct compile_c_instance *) datum;
+  compile_c_instance *context = static_cast<compile_c_instance *> (datum);
   domain_enum domain;
   int found = 0;
 
@@ -386,7 +388,7 @@ gcc_address
 gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
                    const char *identifier)
 {
-  struct compile_c_instance *context = (struct compile_c_instance *) datum;
+  compile_c_instance *context = static_cast<compile_c_instance *> (datum);
   gcc_address result = 0;
   int found = 0;
 
index b80342452889321e092fbae67d240e6e9918b7d1..47a1925b1ac4127a2727fe03c56373b4f503f6ab 100644 (file)
 #include "compile-internal.h"
 #include "compile-c.h"
 
+using namespace compile;
+
 /* Convert a pointer type to its gcc representation.  */
 
 static gcc_type
-convert_pointer (struct compile_c_instance *context, struct type *type)
+convert_pointer (compile_c_instance *context, struct type *type)
 {
   gcc_type target = context->convert_type (TYPE_TARGET_TYPE (type));
 
@@ -36,7 +38,7 @@ convert_pointer (struct compile_c_instance *context, struct type *type)
 /* Convert an array type to its gcc representation.  */
 
 static gcc_type
-convert_array (struct compile_c_instance *context, struct type *type)
+convert_array (compile_c_instance *context, struct type *type)
 {
   gcc_type element_type;
   struct type *range = TYPE_INDEX_TYPE (type);
@@ -86,7 +88,7 @@ convert_array (struct compile_c_instance *context, struct type *type)
 /* Convert a struct or union type to its gcc representation.  */
 
 static gcc_type
-convert_struct_or_union (struct compile_c_instance *context, struct type *type)
+convert_struct_or_union (compile_c_instance *context, struct type *type)
 {
   int i;
   gcc_type result;
@@ -122,7 +124,7 @@ convert_struct_or_union (struct compile_c_instance *context, struct type *type)
 /* Convert an enum type to its gcc representation.  */
 
 static gcc_type
-convert_enum (struct compile_c_instance *context, struct type *type)
+convert_enum (compile_c_instance *context, struct type *type)
 {
   gcc_type int_type, result;
   int i;
@@ -148,7 +150,7 @@ convert_enum (struct compile_c_instance *context, struct type *type)
 /* Convert a function type to its gcc representation.  */
 
 static gcc_type
-convert_func (struct compile_c_instance *context, struct type *type)
+convert_func (compile_c_instance *context, struct type *type)
 {
   int i;
   gcc_type result, return_type;
@@ -173,7 +175,7 @@ convert_func (struct compile_c_instance *context, struct type *type)
 /* Convert an integer type to its gcc representation.  */
 
 static gcc_type
-convert_int (struct compile_c_instance *context, struct type *type)
+convert_int (compile_c_instance *context, struct type *type)
 {
   if (context->c_version () >= GCC_C_FE_VERSION_1)
     {
@@ -192,7 +194,7 @@ convert_int (struct compile_c_instance *context, struct type *type)
 /* Convert a floating-point type to its gcc representation.  */
 
 static gcc_type
-convert_float (struct compile_c_instance *context, struct type *type)
+convert_float (compile_c_instance *context, struct type *type)
 {
   if (context->c_version () >= GCC_C_FE_VERSION_1)
     return context->float_type (TYPE_LENGTH (type), TYPE_NAME (type));
@@ -203,7 +205,7 @@ convert_float (struct compile_c_instance *context, struct type *type)
 /* Convert the 'void' type to its gcc representation.  */
 
 static gcc_type
-convert_void (struct compile_c_instance *context, struct type *type)
+convert_void (compile_c_instance *context, struct type *type)
 {
   return context->void_type ();
 }
@@ -211,7 +213,7 @@ convert_void (struct compile_c_instance *context, struct type *type)
 /* Convert a boolean type to its gcc representation.  */
 
 static gcc_type
-convert_bool (struct compile_c_instance *context, struct type *type)
+convert_bool (compile_c_instance *context, struct type *type)
 {
   return context->bool_type ();
 }
@@ -219,7 +221,7 @@ convert_bool (struct compile_c_instance *context, struct type *type)
 /* Convert a qualified type to its gcc representation.  */
 
 static gcc_type
-convert_qualified (struct compile_c_instance *context, struct type *type)
+convert_qualified (compile_c_instance *context, struct type *type)
 {
   struct type *unqual = make_unqualified_type (type);
   gcc_type unqual_converted;
@@ -240,7 +242,7 @@ convert_qualified (struct compile_c_instance *context, struct type *type)
 /* Convert a complex type to its gcc representation.  */
 
 static gcc_type
-convert_complex (struct compile_c_instance *context, struct type *type)
+convert_complex (compile_c_instance *context, struct type *type)
 {
   gcc_type base = context->convert_type (TYPE_TARGET_TYPE (type));
 
@@ -253,7 +255,7 @@ convert_complex (struct compile_c_instance *context, struct type *type)
    returns the gcc type.  */
 
 static gcc_type
-convert_type_basic (struct compile_c_instance *context, struct type *type)
+convert_type_basic (compile_c_instance *context, struct type *type)
 {
   /* If we are converting a qualified type, first convert the
      unqualified type and then apply the qualifiers.  */
@@ -299,6 +301,15 @@ convert_type_basic (struct compile_c_instance *context, struct type *type)
   return context->error (_("cannot convert gdb type to gcc type"));
 }
 
+/* Default compile flags for C.  */
+
+const char *compile_c_instance::m_default_cflags = "-std=gnu11"
+  /* Otherwise the .o file may need
+     "_Unwind_Resume" and
+     "__gcc_personality_v0".  */
+  " -fno-exceptions"
+  " -Wno-implicit-function-declaration";
+
 gcc_type
 compile_c_instance::convert_type (struct type *type)
 {
index a7024116757ec6a73f29e9a1eca0519afff21aa4..fd2b380c057b1fabb257a15c77c8300ee62f2497 100644 (file)
@@ -30,118 +30,118 @@ extern gcc_c_oracle_function gcc_convert_symbol;
 
 extern gcc_c_symbol_address_function gcc_symbol_address;
 
-/* A subclass of compile_instance that is specific to the C front
-   end.  */
-
-class compile_c_instance
-  : public compile_instance
+namespace compile
 {
- public:
 
-  compile_c_instance (struct gcc_base_context *base, const char *options)
-    : compile_instance (base, options)
+  /* A subclass of compile_instance that is specific to the C front
+     end.  */
+
+  class compile_c_instance
+    : public compile_instance
+  {
+  public:
+
+    compile_c_instance (struct gcc_base_context *base, const char *options)
+      : compile_instance (base, options)
     {
     }
 
-  explicit compile_c_instance (struct gcc_c_context *gcc_c)
-    : compile_instance (&gcc_c->base,
-                       "-std=gnu11"
-                       /* Otherwise the .o file may need
-                          "_Unwind_Resume" and
-                          "__gcc_personality_v0".  */
-                       " -fno-exceptions"
-                       " -Wno-implicit-function-declaration"),
-      m_context (gcc_c)
-  {
-    m_context->c_ops->set_callbacks (m_context, gcc_convert_symbol,
-                                    gcc_symbol_address, this);
-  }
+    explicit compile_c_instance (struct gcc_c_context *gcc_c)
+      : compile_instance (&gcc_c->base, m_default_cflags), m_context (gcc_c)
+    {
+      m_context->c_ops->set_callbacks (m_context, gcc_convert_symbol,
+                                      gcc_symbol_address, this);
+    }
 
-  ~compile_c_instance ()
+    ~compile_c_instance ()
     {
       m_gcc_fe->ops->destroy (m_gcc_fe);
     }
 
-  /* Convert a gdb type, TYPE, to a GCC type.
+    /* Convert a gdb type, TYPE, to a GCC type.
+
+       The new GCC type is returned.  */
 
-     The new GCC type is returned.  */
+    gcc_type convert_type (struct type *type);
 
-  gcc_type convert_type (struct type *type);
+    /* Plug-in forwards  */
 
-  /* Plug-in forwards  */
+    unsigned int c_version () const;
 
-  unsigned int c_version () const;
+    bool tagbind (const char *name, gcc_type tagged_type, const char *filename,
+                 unsigned int line_number);
 
-  bool tagbind (const char *name, gcc_type tagged_type, const char *filename,
-               unsigned int line_number);
+    bool build_constant (gcc_type type, const char *name, unsigned long value,
+                        const char *filename, unsigned int line_number);
 
-  bool build_constant (gcc_type type, const char *name, unsigned long value,
-                      const char *filename, unsigned int line_number);
+    gcc_decl build_decl (const char *name, enum gcc_c_symbol_kind sym_kind,
+                        gcc_type sym_type, const char *substitution_name,
+                        gcc_address address, const char *filename,
+                        unsigned int line_number);
 
-  gcc_decl build_decl (const char *name, enum gcc_c_symbol_kind sym_kind,
-                      gcc_type sym_type, const char *substitution_name,
-                      gcc_address address, const char *filename,
-                      unsigned int line_number);
+    bool bind (gcc_decl decl, bool is_global);
 
-  bool bind (gcc_decl decl, bool is_global);
+    gcc_type error (const char *message);
 
-  gcc_type error (const char *message);
+    gcc_type build_pointer_type (gcc_type base_type);
 
-  gcc_type build_pointer_type (gcc_type base_type);
+    gcc_type build_vla_array_type (gcc_type element_type,
+                                  const char *upper_bound_name);
 
-  gcc_type build_vla_array_type (gcc_type element_type,
-                                const char *upper_bound_name);
+    gcc_type build_vector_type (gcc_type element_type, int num_elements);
 
-  gcc_type build_vector_type (gcc_type element_type, int num_elements);
+    gcc_type build_array_type (gcc_type element_type, int num_elements);
 
-  gcc_type build_array_type (gcc_type element_type, int num_elements);
+    gcc_type build_record_type ();
 
-  gcc_type build_record_type ();
+    gcc_type build_union_type ();
 
-  gcc_type build_union_type ();
+    bool build_add_field (gcc_type record_or_union_type, const char *field_name,
+                         gcc_type field_type, unsigned long bitsize,
+                         unsigned long bitpos);
 
-  bool build_add_field (gcc_type record_or_union_type, const char *field_name,
-                       gcc_type field_type, unsigned long bitsize,
-                       unsigned long bitpos);
+    bool finish_record_or_union (gcc_type record_or_union_type,
+                                unsigned long size_in_bytes);
 
-  bool finish_record_or_union (gcc_type record_or_union_type,
-                              unsigned long size_in_bytes);
+    gcc_type int_type (bool is_unsigned, unsigned long size_in_bytes,
+                      const char *builtin_name);
 
-  gcc_type int_type (bool is_unsigned, unsigned long size_in_bytes,
-                    const char *builtin_name);
+    gcc_type int_type (bool is_unsigned, unsigned long size_in_bytes);
 
-  gcc_type int_type (bool is_unsigned, unsigned long size_in_bytes);
+    gcc_type build_enum_type (gcc_type underlying_int_type);
 
-  gcc_type build_enum_type (gcc_type underlying_int_type);
+    bool build_add_enum_constant (gcc_type enum_type, const char *name,
+                                 unsigned long value);
 
-  bool build_add_enum_constant (gcc_type enum_type, const char *name,
-                               unsigned long value);
+    bool finish_enum_type (gcc_type enum_type);
 
-  bool finish_enum_type (gcc_type enum_type);
+    gcc_type build_function_type (gcc_type return_value,
+                                 const struct gcc_type_array *argument_types,
+                                 bool is_varargs);
 
-  gcc_type build_function_type (gcc_type return_value,
-                               const struct gcc_type_array *argument_types,
-                               bool is_varargs);
+    gcc_type char_type ();
 
-  gcc_type char_type ();
+    gcc_type float_type (unsigned long size_in_bytes, const char *builtin_name);
 
-  gcc_type float_type (unsigned long size_in_bytes, const char *builtin_name);
+    gcc_type float_type (unsigned long size_in_bytes);
 
-  gcc_type float_type (unsigned long size_in_bytes);
+    gcc_type void_type ();
 
-  gcc_type void_type ();
+    gcc_type bool_type ();
 
-  gcc_type bool_type ();
+    gcc_type build_qualified_type (gcc_type unqualified_type,
+                                  enum gcc_qualifiers qualifiers);
 
-  gcc_type build_qualified_type (gcc_type unqualified_type,
-                                enum gcc_qualifiers qualifiers);
+    gcc_type build_complex_type (gcc_type element_type);
 
-  gcc_type build_complex_type (gcc_type element_type);
+  private:
 
-private:
+    /* Default compiler flags for C.  */
+    static const char *m_default_cflags;
 
-  /* The GCC C context.  */
-  struct gcc_c_context *m_context;
+    /* The GCC C context.  */
+    struct gcc_c_context *m_context;
+  };
 };
 
 /* Emit code to compute the address for all the local variables in
@@ -150,7 +150,7 @@ private:
    register is needed to compute a local variable.  */
 
 extern unsigned char *generate_c_for_variable_locations
-     (compile_instance *compiler,
+     (compile::compile_instance *compiler,
       string_file &stream,
       struct gdbarch *gdbarch,
       const struct block *block,
index d4a1d37c5b29a8336c0d77df193cab27cb337f5d..4b2bf46baaef32ea1838a8a59bb058ad77e7676f 100644 (file)
@@ -178,7 +178,7 @@ void
 compile_cplus_instance::maybe_define_new_function_template
   (const struct symbol *sym, struct type *parent_type, int f_idx,
    int m_idx)
-    
+
 {
   if (sym != NULL && SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION (sym))
     {
index ce1b9399720bd98d31821b03dd97e5570d7b0832..5265524619987e235104071fe273c4bc883fcb58 100644 (file)
@@ -888,7 +888,7 @@ compile::maybe_canonicalize_special_function
              *ignore = true;
              return field_name; /* C?  */
 
-           case unknown_ctor:
+           case not_ctor:
 #if DEBUG_XTOR
              printf ("unknown_ctr -- ignored\n");
 #endif
@@ -944,9 +944,9 @@ compile::maybe_canonicalize_special_function
              *ignore = true;
              return field_name; /* D?  */
 
-           case unknown_dtor:
+           case not_dtor:
 #if DEBUG_XTOR
-             printf ("unknown_dtor -- ignored\n");
+             printf ("not_dtor -- ignored\n");
 #endif
              *ignore = true;
              return field_name; /* unknown  */
@@ -1755,14 +1755,17 @@ compile_cplus_instance::convert_type (struct type *type,
 
 \f
 
+/* Default compile flags for C++.  */
+
+const char *compile_cplus_instance::m_default_cflags = "-std=gnu++11";
+
 /* See compile-cplus.h.  */
 
 compile_cplus_instance::compile_cplus_instance (struct gcc_cp_context *gcc_fe)
-  : compile_instance (&gcc_fe->base,
-                     "-std=gnu++11"),
-  m_context (gcc_fe),
-  m_function_template_defns (new function_template_defn_map_t ()),
-  m_class_template_defns (new class_template_defn_map_t ())
+  : compile_instance (&gcc_fe->base, m_default_cflags),
+    m_context (gcc_fe),
+    m_function_template_defns (new function_template_defn_map_t ()),
+    m_class_template_defns (new class_template_defn_map_t ())
 {
   gcc_fe->cp_ops->set_callbacks (gcc_fe, gcc_cplus_convert_symbol,
                                 gcc_cplus_symbol_address,
index f9d2fef8ff6c2b8bdf0363e4bf30b162093a52df..2ab31fe163424c3ed42046cf2f15169de7a74228 100644 (file)
@@ -192,8 +192,7 @@ namespace compile
 
     void leave_scope ();
 
-    /* !!keiths: YUCK!
-       Plug-in forwards  */
+    /* Plug-in forwards  */
 
     gcc_type get_bool_type ();
 
@@ -237,7 +236,8 @@ namespace compile
 
     bool finish_enum_type (gcc_type enum_type);
 
-    /* NAME for debugging  */
+    /* NAME is for debugging only.  */
+
     bool finish_class_type (const char *name, unsigned long size_in_bytes);
 
     gcc_type get_float_type (unsigned long size_in_bytes,
@@ -248,7 +248,8 @@ namespace compile
 
     gcc_expr build_literal_expr (gcc_type type, unsigned long value);
 
-    /* DECL_DESC for debugging only  */
+    /* DECL_DESC is for debugging only.  */
+
     gcc_decl build_decl (const char *decl_desc, const char *name,
                         enum gcc_cp_symbol_kind sym_kind,
                         gcc_type sym_type, const char *substitution_name,
@@ -269,7 +270,8 @@ namespace compile
                                             const char *filename,
                                             unsigned int line_number);
 
-    /* NAME is for debugging only  */
+    /* NAME is for debugging only.  */
+
     bool pop_binding_level (const char *name);
 
     bool push_namespace (const char *name);
@@ -282,7 +284,8 @@ namespace compile
       (struct template_symbol *concrete, gcc_address address,
        const char *filename, unsigned int line_number);
 
-    /* NAME only for debugging  */
+    /* NAME is for debugging only.  */
+
     gcc_type start_class_type (const char *name, gcc_decl typedecl,
                               const struct gcc_vbase_array *base_classes,
                               const char *filename,
@@ -294,7 +297,8 @@ namespace compile
                              const char *filename,
                              unsigned int line_number);
 
-    /* GENERIC only for debugging  */
+    /* GENERIC is for debugging only.  */
+
     bool start_template_decl (const char *generic);
 
     gcc_type get_void_type ();
@@ -302,6 +306,9 @@ namespace compile
 
   private:
 
+    /* Default compiler flags for C++.  */
+    static const char *m_default_cflags;
+
     /* Enumerate the template arguments of template DEFN into DEST.  */
 
     void enumerate_template_arguments
index d883a46f944703db8eb024bd952ac4922047ba9b..71522827c685b0f3330da8e937d6e6f7140e7015 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "defs.h"
 #include "gcc-c-interface.h"
-#include "compile-internal.h"
 
 #include <string>
 #include <unordered_map>
@@ -34,147 +33,150 @@ extern int debug_compile_oracle;
 
 struct block;
 
-/* An object of this type holds state associated with a given
-   compilation job.  */
-
-class compile_instance
+namespace compile
 {
-public:
+  /* An object of this type holds state associated with a given
+     compilation job.  */
 
-  compile_instance (struct gcc_base_context *gcc_fe, const char *options)
-    : m_gcc_fe (gcc_fe), m_gcc_target_options (options)
+  class compile_instance
   {
-  }
+  public:
 
-  virtual ~compile_instance ()
-  {
-  }
+    compile_instance (struct gcc_base_context *gcc_fe, const char *options)
+      : m_gcc_fe (gcc_fe), m_gcc_target_options (options)
+    {
+    }
 
-  /* Returns the GCC options to be passed during compilation.  */
+    virtual ~compile_instance ()
+    {
+    }
 
-  const std::string &gcc_target_options () const
-  {
-    return m_gcc_target_options;
-  }
+    /* Returns the GCC options to be passed during compilation.  */
 
-  /* Insert GCC_TYPE into the type cache for TYPE.
+    const std::string &gcc_target_options () const
+    {
+      return m_gcc_target_options;
+    }
 
-     It is ok for a given type to be inserted more than once, provided that
-     the exact same association is made each time.  */
+    /* Insert GCC_TYPE into the type cache for TYPE.
 
-  void insert_type (struct type *type, gcc_type gcc_type);
+       It is ok for a given type to be inserted more than once, provided that
+       the exact same association is made each time.  */
 
-  /* Associate SYMBOL with some error text.  */
+    void insert_type (struct type *type, gcc_type gcc_type);
 
-  void insert_symbol_error (const struct symbol *sym, std::string text);
+    /* Associate SYMBOL with some error text.  */
 
-  /* Emit the error message corresponding to SYM, if one exists, and
-     arrange for it not to be emitted again.  */
+    void insert_symbol_error (const struct symbol *sym, std::string text);
 
-  void error_symbol_once (const struct symbol *sym);
+    /* Emit the error message corresponding to SYM, if one exists, and
+       arrange for it not to be emitted again.  */
 
-  /* These currently just forward to the underlying ops
-     vtable.  */
+    void error_symbol_once (const struct symbol *sym);
 
-  /* Set the plug-in print callback.  */
+    /* These currently just forward to the underlying ops
+       vtable.  */
 
-  void set_print_callback (void (*print_function) (void *, const char *),
-                          void *datum);
+    /* Set the plug-in print callback.  */
 
-  /* Return the plug-in's front-end version.  */
+    void set_print_callback (void (*print_function) (void *, const char *),
+                            void *datum);
 
-  unsigned int version () const;
+    /* Return the plug-in's front-end version.  */
 
-  /* Set the plug-in's verbosity level.  */
+    unsigned int version () const;
 
-  void set_verbose (int level);
+    /* Set the plug-in's verbosity level.  */
 
-  /* Set the plug-in driver program.  */
+    void set_verbose (int level);
 
-  void set_driver_filename (const char *filename);
+    /* Set the plug-in driver program.  */
 
-  /* Set the regular expression used to match the configury triplet
-     prefix to the compiler.  */
+    void set_driver_filename (const char *filename);
 
-  void set_triplet_regexp (const char *regexp);
+    /* Set the regular expression used to match the configury triplet
+       prefix to the compiler.  */
 
-  /* Set compilation arguments.  */
+    void set_triplet_regexp (const char *regexp);
 
-  char *set_arguments (int argc, char **argv);
+    /* Set compilation arguments.  */
 
-  /* !!keiths: YUCK!  */
+    char *set_arguments (int argc, char **argv);
 
-  char *set_arguments (const char *regexp, int argc, char **argv);
+    /* As above for protocol version 0.  */
 
-  /* Set the filename of the program to compile.  */
+    char *set_arguments (const char *regexp, int argc, char **argv);
 
-  void set_source_file (const char *filename);
+    /* Set the filename of the program to compile.  */
 
-  /* Compile the previously specified source file to FILENAME.  */
+    void set_source_file (const char *filename);
 
-  bool compile (const char *filename);
+    /* Compile the previously specified source file to FILENAME.  */
 
-  /* Same as above, but for earlier protocol versions.  */
+    bool compile (const char *filename);
 
-  bool compile (const char *filename, int verbose_level);
+    /* Same as above, but for earlier protocol versions.  */
 
-  /* Set the scope type for this compile.  */
+    bool compile (const char *filename, int verbose_level);
 
-  void set_scope (enum compile_i_scope_types scope)
-  {
-    m_scope = scope;
-  }
+    /* Set the scope type for this compile.  */
 
-  /* Return the scope type.  */
+    void set_scope (enum compile_i_scope_types scope)
+    {
+      m_scope = scope;
+    }
 
-  enum compile_i_scope_types scope () const
-  {
-    return m_scope;
-  }
+    /* Return the scope type.  */
 
-  /* Set the block to be used for symbol searches.  */
+    enum compile_i_scope_types scope () const
+    {
+      return m_scope;
+    }
 
-  void set_block (const struct block *block)
-  {
-    m_block = block;
-  }
+    /* Set the block to be used for symbol searches.  */
 
-  /* Return the search block.  */
+    void set_block (const struct block *block)
+    {
+      m_block = block;
+    }
 
-  const struct block *block () const
-  {
-    return m_block;
-  }
+    /* Return the search block.  */
+
+    const struct block *block () const
+    {
+      return m_block;
+    }
 
-protected:
+  protected:
 
-  /* Map types used by the compile instance for caching type conversions.
-     and error tracking.  */
+    /* Map types used by the compile instance for caching type conversions.
+       and error tracking.  */
 
-  typedef std::pair<struct type *, gcc_type> type_map_item_t;
-  typedef std::unordered_map<struct type *, gcc_type> type_map_t;
-  typedef std::pair<const struct symbol *, std::string> symbol_err_map_item_t;
-  typedef std::unordered_map<const struct symbol *, std::string>
+    typedef std::pair<struct type *, gcc_type> type_map_item_t;
+    typedef std::unordered_map<struct type *, gcc_type> type_map_t;
+    typedef std::pair<const struct symbol *, std::string> symbol_err_map_item_t;
+    typedef std::unordered_map<const struct symbol *, std::string>
     symbol_err_map_t;
 
-  /* The GCC front end.  */
-  struct gcc_base_context *m_gcc_fe;
+    /* The GCC front end.  */
+    struct gcc_base_context *m_gcc_fe;
 
-  /* The "scope" of this compilation.  */
-  enum compile_i_scope_types m_scope;
+    /* The "scope" of this compilation.  */
+    enum compile_i_scope_types m_scope;
 
-  /* The block in which an expression is being parsed.  */
-  const struct block *m_block;
+    /* The block in which an expression is being parsed.  */
+    const struct block *m_block;
 
-  /* Specify "-std=gnu11", "-std=gnu++11" or similar.  These options are put
-     after CU's DW_AT_producer compilation options to override them.  */
-  std::string m_gcc_target_options;
+    /* Specify "-std=gnu11", "-std=gnu++11" or similar.  These options are put
+       after CU's DW_AT_producer compilation options to override them.  */
+    std::string m_gcc_target_options;
 
-  /* Map from gdb types to gcc types.  */
-  type_map_t m_type_map;
+    /* Map from gdb types to gcc types.  */
+    type_map_t m_type_map;
 
-  /* Map from gdb symbols to gcc error messages to emit.  */
-  symbol_err_map_t m_symbol_err_map;
+    /* Map from gdb symbols to gcc error messages to emit.  */
+    symbol_err_map_t m_symbol_err_map;
+  };
 };
 
 /* Define the headers and footers for different scopes.  */
index 23c68c9e0f8301dfbd59ff8fb4b0fb4a3ba27fc4..a0a5d73de87c3b7f5437324f8dffa91a89ff44ae 100644 (file)
@@ -420,8 +420,8 @@ filter_args (int *argcp, char **argv)
    generated above.  */
 
 static void
-get_args (const struct compile_instance *compiler, struct gdbarch *gdbarch,
-         int *argcp, char ***argvp)
+get_args (const compile::compile_instance *compiler,
+         struct gdbarch *gdbarch, int *argcp, char ***argvp)
 {
   const char *cs_producer_options;
   int argc_compiler;
@@ -455,7 +455,8 @@ get_args (const struct compile_instance *compiler, struct gdbarch *gdbarch,
 static void
 cleanup_compile_instance (void *arg)
 {
-  struct compile_instance *inst = (struct compile_instance *) arg;
+  compile::compile_instance *inst
+    = static_cast<compile::compile_instance *> (arg);
 
   delete inst;
 }
@@ -487,7 +488,7 @@ static compile_file_names
 compile_to_object (struct command_line *cmd, const char *cmd_string,
                   enum compile_i_scope_types scope)
 {
-  struct compile_instance *compiler;
+  compile::compile_instance *compiler;
   struct cleanup *cleanup, *inner_cleanup;
   const struct block *expr_block;
   CORE_ADDR trash_pc, expr_pc;
@@ -574,7 +575,6 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
   get_args (compiler, gdbarch, &argc, &argv);
   make_cleanup_freeargv (argv);
 
-  /* !!keiths: This should be hidden at this level!  */
   if (compiler->version ()>= GCC_FE_VERSION_1)
     error_message = compiler->set_arguments (argc, argv);
   else
@@ -698,7 +698,7 @@ compile_register_name_demangle (struct gdbarch *gdbarch,
 /* See description in compile-internal.h.  */
 
 void
-compile_instance::insert_type (struct type *type, gcc_type gcc_type)
+compile::compile_instance::insert_type (struct type *type, gcc_type gcc_type)
 {
   type_map_t::iterator pos = m_type_map.find (type);
 
@@ -717,8 +717,8 @@ compile_instance::insert_type (struct type *type, gcc_type gcc_type)
 /* See description in compile-internal.h.  */
 
 void
-compile_instance::insert_symbol_error (const struct symbol *sym,
-                                      std::string text)
+compile::compile_instance::insert_symbol_error (const struct symbol *sym,
+                                               std::string text)
 {
   symbol_err_map_t::iterator pos = m_symbol_err_map.find (sym);
 
@@ -729,7 +729,7 @@ compile_instance::insert_symbol_error (const struct symbol *sym,
 /* See description in compile-internal.h.  */
 
 void
-compile_instance::error_symbol_once (const struct symbol *sym)
+compile::compile_instance::error_symbol_once (const struct symbol *sym)
 {
   symbol_err_map_t::iterator pos = m_symbol_err_map.find (sym);
   if (pos == m_symbol_err_map.end () || pos->second.length () == 0)
@@ -747,7 +747,7 @@ compile_instance::error_symbol_once (const struct symbol *sym)
 /* Set the plug-in print callback.  */
 
 void
-compile_instance::set_print_callback
+compile::compile_instance::set_print_callback
   (void (*print_function) (void *, const char *), void *datum)
 {
   FORWARD (set_print_callback, print_function, datum);
@@ -756,7 +756,7 @@ compile_instance::set_print_callback
 /* Return the plug-in's front-end version.  */
 
 unsigned int
-compile_instance::version () const
+compile::compile_instance::version () const
 {
   return m_gcc_fe->ops->version;
 }
@@ -764,7 +764,7 @@ compile_instance::version () const
 /* Set the plug-in's verbosity level.  */
 
 void
-compile_instance::set_verbose (int level)
+compile::compile_instance::set_verbose (int level)
 {
   FORWARD (set_verbose, level);
 }
@@ -772,9 +772,8 @@ compile_instance::set_verbose (int level)
 /* Set the plug-in driver program.  */
 
 void
-compile_instance::set_driver_filename (const char *filename)
+compile::compile_instance::set_driver_filename (const char *filename)
 {
-  /* !!keiths: Possible leak???  */
   FORWARD (set_driver_filename, filename);
 }
 
@@ -782,24 +781,24 @@ compile_instance::set_driver_filename (const char *filename)
    prefix to the compiler.  */
 
 void
-compile_instance::set_triplet_regexp (const char *regexp)
+compile::compile_instance::set_triplet_regexp (const char *regexp)
 {
-  /* !!keiths: Leak?  */
   FORWARD (set_triplet_regexp, regexp);
 }
 
 /* Set compilation arguments.  */
 
 char *
-compile_instance::set_arguments (int argc, char **argv)
+compile::compile_instance::set_arguments (int argc, char **argv)
 {
   return FORWARD (set_arguments, argc, argv);
 }
 
-/* !!keiths: YUCK!  */
+/* As above, for protocol version 0.  */
 
 char *
-compile_instance::set_arguments (const char *regexp, int argc, char **argv)
+compile::compile_instance::set_arguments (const char *regexp, int argc, char
+                                         **argv)
 {
   return FORWARD (set_arguments_v0, regexp, argc, argv);
 }
@@ -807,7 +806,7 @@ compile_instance::set_arguments (const char *regexp, int argc, char **argv)
 /* Set the filename of the program to compile.  */
 
 void
-compile_instance::set_source_file (const char *filename)
+compile::compile_instance::set_source_file (const char *filename)
 {
   FORWARD (set_source_file, filename);
 }
@@ -815,7 +814,7 @@ compile_instance::set_source_file (const char *filename)
 /* Compile the previously specified source file to FILENAME.  */
 
 bool
-compile_instance::compile (const char *filename)
+compile::compile_instance::compile (const char *filename)
 {
   return FORWARD (compile, filename);
 }
@@ -823,7 +822,7 @@ compile_instance::compile (const char *filename)
 /* As above, but for an earlier compile protocol.  */
 
 bool
-compile_instance::compile (const char *filename, int verbose_level)
+compile::compile_instance::compile (const char *filename, int verbose_level)
 {
   return FORWARD (compile_v0, filename, verbose_level);
 }
index 43833d0094ecaff0f2a41d12ba590f7cbb788235..9620da10f9c1b58e320593500c6dc8fe3bb483c6 100644 (file)
@@ -39,9 +39,12 @@ struct frame_info;
    non-zero.  */
 enum ctor_kinds {
 
+  /* Unrecognized or not a constructor.  */
+  not_ctor = 0,
+
   /* Initialize a complete object, including virtual bases, using
      memory provided by caller.  */
-  complete_object_ctor = 1,
+  complete_object_ctor,
 
   /* Initialize a base object of some larger object.  */
   base_object_ctor,
@@ -53,10 +56,7 @@ enum ctor_kinds {
   unified_ctor,
 
   /* Deprecated?  */
-  object_ctor_group,
-
-  /* Unknown constructor, e.g., no linkage name.  */
-  unknown_ctor
+  object_ctor_group
 };
 
 /* Return non-zero iff NAME is the mangled name of a constructor.
@@ -69,9 +69,12 @@ extern enum ctor_kinds is_constructor_name (const char *name);
    non-zero.  */
 enum dtor_kinds {
 
+  /* Unrecognized or not a destructor.  */
+  not_dtor = 0,
+
   /* A destructor which finalizes the entire object, and then calls
      `delete' on its storage.  */
-  deleting_dtor = 1,
+  deleting_dtor,
 
   /* A destructor which finalizes the entire object, but does not call
      `delete'.  */
@@ -85,10 +88,7 @@ enum dtor_kinds {
   unified_dtor,
 
   /* Deprecated?  */
-  object_dtor_group,
-
-  /* Unknown destructor, e.g., no linkage name.  */
-  unknown_dtor
+  object_dtor_group
 };
 
 /* Kinds of template arguments.  */
index 88e1b3276e027dfa83ae9b9c1319f16415e13a62..f77546a2cadd5377bc74ae4aa113dd76efa6bf47 100644 (file)
@@ -1689,8 +1689,8 @@ cp_decode_template_type_indices (struct template_symbol *tsymbol,
 
   if (tsymbol->linkage_name == NULL)
     {
-      /* !!keiths: I can't even issue a good error message!  */
-      warning (_("Template symbol has no linkage name."));
+      warning (_("Template symbol \"%s\" has no linkage name."),
+              SYMBOL_NATURAL_NAME (&tsymbol->base));
       return;
     }
 
@@ -1719,8 +1719,6 @@ cp_decode_template_type_indices (struct template_symbol *tsymbol,
       info = dpi.get ();
     }
 
-  /* !!keiths will certainly require extensive testing/revision.  */
-
   /* Determine the return type index.  */
   ret_comp = info->tree;
   if (ret_comp->type == DEMANGLE_COMPONENT_TYPED_NAME)
index 7c5005b213e4c74299c70638c9d6a436be39dff0..85d6461eef6c3cab3c06f0a0593e768fb0a0f17c 100644 (file)
@@ -178,13 +178,6 @@ extern struct cmd_list_element *maint_cplus_cmd_list;
 
 char *gdb_demangle (const char *name, int options);
 
-/* Find the fn_field for the method with symbol METHOD_SYMBOL in its
-   parent class.  If XTOR_ONLY is non-zero, any symbols not representing a
-   constructor or destructor will return NULL.   */
-
-extern struct fn_field *cp_find_method_field (struct symbol *method_symbol,
-                                             int xtor_only);
-
 /* Decode template information for TSYMBOL.  This function determines whether
    the template's return and argument types are concrete types or template
    parameters.  The symbol's obstack is used to allocate any needed memory.
index 48acc968156dd535b0d15fe815d3183086a7f154..835cfb4079b6f975a52d4d36915802116daf6c56 100644 (file)
@@ -6918,7 +6918,8 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
     {
     case DW_TAG_subprogram:
       addr = gdbarch_adjust_dwarf2_addr (gdbarch, pdi->lowpc + baseaddr);
-      if (pdi->is_external || cu->language == language_ada || cu->language == language_cplus)
+      if (pdi->is_external || cu->language == language_ada
+         || cu->language == language_cplus)
        {
           /* brobecker/2007-12-26: Normally, only "external" DIEs are part
              of the global scope.  But in Ada, we want to be able to access
@@ -8842,10 +8843,10 @@ add_xtor_field (struct type *parent_type,
          methods[idx] = new_fn_field (name_die, name_cu, type_die, type_cu,
                                       parent_type, name, idx, i);
 
-         /* If this is an aliased xtor, mark it as a duplicate so that
+         /* If this is an aliased xtor, mark it as an alias so that
             it will be ignored during symbol searches and type printing.  */
          if (name_die != type_die)
-           TYPE_FN_FIELD_DUPLICATE (methods, idx) = 1;
+           TYPE_FN_FIELD_ALIAS (methods, idx) = 1;
 
          return;
        }
@@ -8915,17 +8916,17 @@ read_imported_decl (struct die_info *die, struct dwarf2_cu *cu)
              if (linkage_name != NULL)
                {
                  enum ctor_kinds ctor_kind;
-                 enum dtor_kinds dtor_kind = (enum dtor_kinds) 0;
+                 enum dtor_kinds dtor_kind = not_dtor;
 
                  ctor_kind = is_constructor_name (linkage_name);
-                 if (ctor_kind == 0)
+                 if (ctor_kind == not_ctor)
                    dtor_kind = is_destructor_name (linkage_name);
 
                  /* GCC outputs imported_declaration for C1 constructors
                     and D1 destructors which alias to the C4/D4/unified
                     ctor/dtor listed in the parent class's DIE tree.
                     Deal with those here.  */
-                 if (ctor_kind !=  0 || dtor_kind != 0)
+                 if (ctor_kind !=  not_ctor || dtor_kind != not_dtor)
                    {
                      struct die_info *imported_die, *spec_die, *parent_die;
                      struct die_info *type_die;
@@ -11448,17 +11449,17 @@ possibly_add_new_xtor_method (const char *name, struct die_info *die,
                              struct dwarf2_cu *cu)
 {
   const char *linkage_name = dw2_linkage_name (die, cu);
-  enum ctor_kinds ctor_kind;
 
   if (linkage_name == NULL || cu->language != language_cplus)
     return;
 
-  ctor_kind = is_constructor_name (linkage_name);
-  if (ctor_kind == 0)
+  enum ctor_kinds ctor_kind = is_constructor_name (linkage_name);
+
+  if (ctor_kind == not_ctor)
     {
       enum dtor_kinds dtor_kind = is_destructor_name (linkage_name);
 
-      if (dtor_kind == 0)
+      if (dtor_kind == not_dtor)
        return;
     }
 
@@ -12905,8 +12906,7 @@ dwarf2_add_type_defn (struct field_info *fip, struct die_info *die,
              || die->tag == DW_TAG_class_type
              || die->tag == DW_TAG_structure_type
              || die->tag == DW_TAG_union_type
-             || die->tag == DW_TAG_enumeration_type
-             /*|| die->tag == DW_TAG_namespace*/);
+             || die->tag == DW_TAG_enumeration_type);
 
   fp = &new_field->field;
 
@@ -12922,11 +12922,9 @@ dwarf2_add_type_defn (struct field_info *fip, struct die_info *die,
     accessibility = dwarf2_default_access_attribute (die, cu);
   switch (accessibility)
     {
-#if 1
     case DW_ACCESS_public:
       fp->is_public = 1;
       break;
-#endif
     case DW_ACCESS_private:
       fp->is_private = 1;
       break;
@@ -13063,13 +13061,13 @@ dwarf2_is_constructor (struct die_info *die, struct dwarf2_cu *cu)
   const char *fieldname;
   const char *type_name;
   int len;
-  const char *linkage_name;
 
   /* If there is a linkage name, use it to determine if this DIE represents
      a constructor.  */
-  linkage_name = dw2_linkage_name (die, cu);
+  const char *linkage_name = dw2_linkage_name (die, cu);
+
   if (linkage_name != NULL)
-    return is_constructor_name (linkage_name) != 0;
+    return is_constructor_name (linkage_name) != not_ctor;
 
   /* Many older versions of GCC do not output DW_AT_linkage_name for
      constructors.  In that case, fallback to a heuristic test.  */
@@ -13097,14 +13095,12 @@ dwarf2_is_constructor (struct die_info *die, struct dwarf2_cu *cu)
 static int
 dwarf2_is_destructor (struct die_info *die, struct dwarf2_cu *cu)
 {
-  const char *fieldname;
-  const char *linkage_name;
-
   /* If there is a linkage name, use it to determine if this DIE represents
      a destructor.  */
-  linkage_name = dw2_linkage_name (die, cu);
+  const char *linkage_name = dw2_linkage_name (die, cu);
+
   if (linkage_name != NULL)
-    return is_destructor_name (linkage_name) != 0;
+    return is_destructor_name (linkage_name) != not_dtor;
 
   if (die->parent == NULL)
     return 0;
@@ -13114,7 +13110,8 @@ dwarf2_is_destructor (struct die_info *die, struct dwarf2_cu *cu)
       && die->parent->tag != DW_TAG_class_type)
     return 0;
 
-  fieldname = dwarf2_name (die, cu);
+  const char *fieldname = dwarf2_name (die, cu);
+
   return (fieldname != NULL && *fieldname == '~');
 }
 
@@ -13217,15 +13214,12 @@ new_fn_field (struct die_info *name_die, struct dwarf2_cu *name_cu,
   fnfield.is_constructor = dwarf2_is_constructor (name_die, type_cu);
   if (fnfield.is_constructor)
     {
-      const char *linkage_name;
+      const char *linkage_name = dw2_linkage_name (name_die, name_cu);
 
-      linkage_name = dw2_linkage_name (name_die, name_cu);
-      if (linkage_name == NULL)
-       fnfield.cdtor_type.ctor_kind = unknown_ctor;
-      else
+      if (linkage_name != NULL)
        {
          fnfield.cdtor_type.ctor_kind = is_constructor_name (linkage_name);
-         gdb_assert (fnfield.cdtor_type.ctor_kind != 0);
+         gdb_assert (fnfield.cdtor_type.ctor_kind != not_ctor);
        }
     }
   else
@@ -13233,18 +13227,12 @@ new_fn_field (struct die_info *name_die, struct dwarf2_cu *name_cu,
       fnfield.is_destructor = dwarf2_is_destructor (name_die, name_cu);
       if (fnfield.is_destructor)
        {
-         const char *linkage_name;
-
-         /* The linkage name can be NULL coming from objfiles created by the
-            GCC compile plug-in.  This special case should be handled by
-            dwarf2_add_member_fn.  */
-         linkage_name = dw2_linkage_name (name_die, name_cu);
-         if (linkage_name == NULL)
-           fnfield.cdtor_type.dtor_kind = unknown_dtor;
-         else
+         const char *linkage_name = dw2_linkage_name (name_die, name_cu);
+
+         if (linkage_name != NULL)
            {
              fnfield.cdtor_type.dtor_kind = is_destructor_name (linkage_name);
-             gdb_assert (fnfield.cdtor_type.dtor_kind != 0);
+             gdb_assert (fnfield.cdtor_type.dtor_kind != not_dtor);
            }
        }
     }
@@ -14584,7 +14572,6 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
        }
     }
 
-#if 1
   if (die->child != NULL)
     {
       struct die_info *child_die = die->child;
@@ -14595,11 +14582,6 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
          child_die = sibling_die (child_die);
        }
     }
-#else
-  /* !!keiths: HACK!  This works around GDB not being able to
-     define the contents of a namespace.  */
-  process_structure_scope (die, cu);
-#endif
 }
 
 /* Read a Fortran module as type.  This DIE can be only a declaration used for
@@ -19651,9 +19633,8 @@ guess_full_die_structure_name (struct die_info *die, struct dwarf2_cu *cu)
     {
       if (child->tag == DW_TAG_subprogram)
        {
-         const char *linkage_name;
+         const char *linkage_name = dw2_linkage_name (child, cu);
 
-         linkage_name = dw2_linkage_name (child, cu);
          if (linkage_name != NULL)
            {
              char *actual_name
index 10949ae8f89aae3446a6100d852cc9b9d4be80e7..5e5db2776b16424491da44427a104239d64fea9a 100644 (file)
@@ -1702,8 +1702,7 @@ set_type_vptr_fieldno (struct type *type, int fieldno)
 {
   type = check_typedef (type);
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
-             || TYPE_CODE (type) == TYPE_CODE_UNION
-             || TYPE_CODE (type) == TYPE_CODE_NAMESPACE /* !!keiths */);
+             || TYPE_CODE (type) == TYPE_CODE_UNION);
   if (!HAVE_CPLUS_STRUCT (type))
     ALLOCATE_CPLUS_STRUCT_TYPE (type);
   TYPE_RAW_CPLUS_SPECIFIC (type)->vptr_fieldno = fieldno;
index 1f1edaca95a0a21f1cd32dbf1954dc8931d9b1bd..c177fed7f8fa0b2d3d9f6403921e65358cbbd982 100644 (file)
@@ -45,7 +45,7 @@
  */
 
 #include "hashtab.h"
-#include "cp-abi.h"  /* !!keiths: YUCK!  */
+#include "cp-abi.h"
 
 /* Forward declarations for prototypes.  */
 struct field;
@@ -876,7 +876,7 @@ struct fn_field
   /* * True if this function is aliased to an existing fn_field,
      false otherwise.  These functions should be skipped during symbol
      lookups or type printing.  */
-  unsigned int is_duplicate : 1;
+  unsigned int is_alias : 1;
 
   /* * Unused.  */
 
@@ -926,9 +926,9 @@ struct template_argument_info
   struct symbol **arguments;
 
   /* * Default values.  An array with n_arguments elements.  Note that this
-     array only describes this particular instance!  It will not describe default
-     values for /all/ template instances (unless this instance uses all the defaults).
-     This is a DWARF limitation.  */
+     array only describes this particular instance!  It will not describe
+     default values for /all/ template instances (unless this instance uses
+     all the defaults).  This is a DWARF limitation.  */
     struct symbol **default_arguments;
 
     /* * The kinds of arguments.  An array with n_arguments elements.  */
@@ -1479,7 +1479,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
 #define TYPE_FN_FIELD_STUB(thisfn, n) ((thisfn)[n].is_stub)
 #define TYPE_FN_FIELD_CONSTRUCTOR(thisfn, n) ((thisfn)[n].is_constructor)
 #define TYPE_FN_FIELD_DESTRUCTOR(thisfn, n) ((thisfn)[n].is_destructor)
-#define TYPE_FN_FIELD_DUPLICATE(thisfn, n) ((thisfn)[n].is_duplicate)
+#define TYPE_FN_FIELD_ALIAS(thisfn, n) ((thisfn)[n].is_alias)
 #define TYPE_FN_FIELD_FCONTEXT(thisfn, n) ((thisfn)[n].fcontext)
 #define TYPE_FN_FIELD_VOFFSET(thisfn, n) ((thisfn)[n].voffset-2)
 #define TYPE_FN_FIELD_VIRTUAL_P(thisfn, n) ((thisfn)[n].voffset > 1)
index 0af684f4546546b80d163891607bc393b5f7bef0..dd6820b0afa84cdc5901362a29975f0acd64285f 100644 (file)
@@ -40,7 +40,7 @@ gnuv2_is_destructor_name (const char *name)
       || startswith (name, "__dt__"))
     return complete_object_dtor;
   else
-    return (enum dtor_kinds) 0;
+    return not_dtor;
 }
 
 static enum ctor_kinds
@@ -51,7 +51,7 @@ gnuv2_is_constructor_name (const char *name)
       || startswith (name, "__ct__"))
     return complete_object_ctor;
   else
-    return (enum ctor_kinds) 0;
+    return not_ctor;
 }
 
 static int
index 38bfb41fdff217df1d1f5130b53328d905372b5b..e39d3162bf5f3c87497ea980a0974598cb552b1b 100644 (file)
@@ -1356,7 +1356,7 @@ gnuv3_is_constructor_name (const char *mangled_name)
   switch (libiberty_kind)
     {
     case 0:
-      kind = (enum ctor_kinds) 0;
+      kind = not_ctor;
       break;
     case gnu_v3_complete_object_ctor:
       kind = complete_object_ctor;
@@ -1393,7 +1393,7 @@ gnuv3_is_destructor_name (const char *mangled_name)
   switch (libiberty_kind)
   {
   case 0:
-    kind = (enum dtor_kinds) 0;
+    kind = not_dtor;
     break;
   case gnu_v3_deleting_dtor:
     kind = deleting_dtor;
index 2bf677c43e7ef4ed1e7a441b9703921ffd33f6d9..4c4468d52b8d5563acc605d07f0471cc7e68ddca 100644 (file)
@@ -35,7 +35,11 @@ struct value_print_options;
 struct type_print_options;
 struct lang_varobj_ops;
 struct parser_state;
-struct compile_instance;
+
+namespace compile
+{
+  class compile_instance;
+};
 
 #define MAX_FORTRAN_DIMS  7    /* Maximum number of F77 array dims.  */
 
@@ -400,7 +404,7 @@ struct language_defn
        instance is owned by its caller and must be deallocated by
        calling its 'destroy' method.  */
 
-    struct compile_instance *(*la_get_compile_instance) (void);
+    compile::compile_instance *(*la_get_compile_instance) (void);
 
     /* This method must be defined if 'la_get_gcc_context' is defined.
        If 'la_get_gcc_context' is not defined, then this method is
@@ -416,7 +420,7 @@ struct language_defn
        parsed.
        EXPR_PC is the PC at which the expression is being parsed.  */
 
-    std::string (*la_compute_program) (struct compile_instance *inst,
+    std::string (*la_compute_program) (compile::compile_instance *inst,
                                       const char *input,
                                       struct gdbarch *gdbarch,
                                       const struct block *expr_block,
index 5031c6a63f0f2cc977120ba6bc0003025a8baa2e..d15d6f2bc730ca9aa41008501679d2f632a4508d 100644 (file)
@@ -2864,114 +2864,6 @@ lookup_prefix_sym (struct linespec_state *state, VEC (symtab_ptr) *file_symtabs,
   return collector.symbols;
 }
 
-/* See cp-support.h for description.  This function is defined here because all
-   the support routines for it are defined in this file.  */
-
-struct fn_field *
-cp_find_method_field (struct symbol *method_symbol, int xtor_only)
-{
-  struct linespec_state state;
-  VEC (block_symbol_d) *syms;
-  VEC (symtab_ptr) *file_symtabs = NULL;
-  struct cleanup *cleanup;
-  struct block_symbol *class_sym;
-  char *class_name, *method_name;
-  const char *last, *p, *method_fullname;
-
-  /* Sanity check: if the symbol's type isn't actually a method, do not
-     bother attempting to find a fn_field for it.  */
-  if (TYPE_CODE (SYMBOL_TYPE (method_symbol)) != TYPE_CODE_METHOD)
-    return NULL;
-
-  /* Find class/method names.  */
-  method_fullname = SYMBOL_NATURAL_NAME (method_symbol);
-  last = NULL;
-  p = find_toplevel_string (method_fullname, "::");
-  while (p != NULL)
-    {
-      last = p;
-      p = find_toplevel_string (p + 2, "::");
-    }
-
-  class_name = XNEWVEC (char, last - method_fullname + 1);
-  cleanup = make_cleanup (xfree, class_name);
-  strncpy (class_name, method_fullname, last - method_fullname);
-  class_name[last - method_fullname] = '\0';
-  last += 2;
-  method_name = XNEWVEC (char, strlen (last) + 1);
-  make_cleanup (xfree, method_name);
-  strcpy (method_name, last);
-
-  if (xtor_only)
-    {
-      int len;
-      char *n = class_name;
-      char *raw_class = cp_func_name (class_name);
-
-      if (raw_class != NULL)
-       n = raw_class;
-
-      /* !!keiths; This test isn't perfect in the general case, but it
-        should be enough for our compiler-centric case which is always
-        well-defined.  Consider moving this code to compile/ somewhere.  */
-      len = strlen (method_name);
-      if (!(strncmp (method_name, n, len) == 0
-           && (n[len] == '\0' || n[len] == '<'))
-         || method_name[0] != '~')
-       {
-         /* Not a constructor or destructor -- return.  */
-         xfree (raw_class);
-         do_cleanups (cleanup);
-         return NULL;
-       }
-
-      xfree (raw_class);
-    }
-
-  memset (&state, 0, sizeof (struct linespec_state));
-  state.language = language_def (language_cplus);
-  VEC_safe_push (symtab_ptr, file_symtabs, symbol_symtab (method_symbol));
-  cleanup = make_cleanup (VEC_cleanup (symtab_ptr), &file_symtabs);
-  syms = lookup_prefix_sym (&state, file_symtabs, class_name);
-  make_cleanup (VEC_cleanup (block_symbol_d), &syms);
-
-  if (!VEC_empty (block_symbol_d, syms))
-    {
-      int i;
-      struct type *class_type;
-
-      /* !!keiths: Can we expect more than one? I don't think so.  */
-      gdb_assert (VEC_length (block_symbol_d, syms) == 1);
-      class_sym = VEC_index (block_symbol_d, syms, 0);
-      class_type = SYMBOL_TYPE (class_sym->symbol);
-
-      /* CLASS_SYM is the parent class... Loop over fn_fields defined in this
-        class looking for the one of matching name and type.  */
-      for (i = 0; i < TYPE_NFN_FIELDS (class_type); ++i)
-       {
-         int j;
-         const char *name = TYPE_FN_FIELDLIST_NAME (class_type, i);
-         struct fn_field *fields = TYPE_FN_FIELDLIST1 (class_type, i);
-
-         if (!streq (name, method_name))
-           continue;
-
-         for (j = 0; j < TYPE_FN_FIELDLIST_LENGTH (class_type, i); ++j)
-           {
-             if (streq (SYMBOL_LINKAGE_NAME (method_symbol),
-                        TYPE_FN_FIELD_PHYSNAME (fields, j)))
-               {
-                 do_cleanups (cleanup);
-                 return &TYPE_FN_FIELD (fields, j);
-               }
-           }
-       }
-    }
-
-  do_cleanups (cleanup);
-  return NULL;
-}
-
 /* A qsort comparison function for symbols.  The resulting order does
    not actually matter; we just need to be able to sort them so that
    symbols with the same program space end up next to each other.  */
index c1177d40a684813f42b1d02b041d4ba5f199a770..3f6029c47c00d150f4f266888ce43c5f12b03856 100644 (file)
@@ -24,7 +24,6 @@
 #include "gdb_vecs.h"
 #include "gdbtypes.h"
 #include "common/enum-flags.h"
-#include "cp-abi.h"  /* !!keiths; YUCK!  Need enum template_argument_kinds!  */
 
 /* Opaque declarations.  */
 struct ui_file;
@@ -1704,9 +1703,14 @@ void initialize_objfile_symbol (struct symbol *);
 
 struct template_symbol *allocate_template_symbol (struct objfile *);
 
+/* Result of a multi-symbol search.  */
+
 struct search_multiple_result
 {
+  /* Matching debug symbols.  */
   VEC (block_symbol_d) *symbols;
+
+  /* Matching non-debug symbols.  */
   VEC (bound_minimal_symbol_d) *minimal_symbols;
 };
 
@@ -1723,12 +1727,10 @@ extern struct search_multiple_result
 
 /* Free the result of search_symbols_multiple.  */
 
-extern void
-  free_search_multiple_result (struct search_multiple_result *);
+extern void free_search_multiple_result (struct search_multiple_result *);
 
 /* A cleanup function for the return result of search_symbols_multiple.  */
 
-extern void
-  search_multiple_result_cleanup (void *);
+extern void search_multiple_result_cleanup (void *);
 
 #endif /* !defined(SYMTAB_H) */
index 7ac4d0b610e94a72bbe4c3659fb4966c72e8d164..cb453a4e1845cdda832b46124a6911029abbf6d4 100644 (file)
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile
 
index 97714ca7a6d66f5bc71e128a6a700f24c8cf1209..3ba46ce947d246dd4685c432a1089f70907db602 100644 (file)
@@ -1,6 +1,6 @@
 /* This testcase is part of GDB, the GNU debugger.
 
-   Copyright 2014-2016 Free Software Foundation, Inc.
+   Copyright 2014-2017 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
@@ -163,10 +163,10 @@ struct VirtualBase : virtual VirtualOnly
 };
 
 struct VirtualBase2 : VirtualBase {};
+
 VirtualBase::VirtualBase (void)
 {
-  z = 24; 
+  z = 24;
 }
 
 VirtualBase::~VirtualBase (void)
@@ -178,7 +178,7 @@ class Foo
 {
   int var;
   static const int public_static_var = 12;
-  
+
  private:
   int private_var = 0;
   int private_method (void);
index 8aefbe74b4de03eb097fb300b8ef597a38a429d3..04849ba39476205a65549f30e22e203084ee576e 100644 (file)
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c
 
@@ -339,5 +339,3 @@ if { $srcfile3 != "" } {
 } else {
     untested "print constvar value"
 }
-
-
index 68c1830d56be29b0b5f42be4a54ad228da01f23c..dc442ffc8acc0afb78a1817e1c6960e8e771a629 100644 (file)
@@ -13,8 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-load_lib compiler-support.exp
-
 standard_testfile
 
 with_test_prefix "nodebug" {
index f92ee3a002b873037a6a0cce8bf48d9fd2025b7d..6e178b0674902d92a87ead6b2825e3263e467be6 100644 (file)
@@ -17,7 +17,6 @@
 # integration.
 
 load_lib dwarf.exp
-load_lib compiler-support.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
 if {![dwarf2_support]} {
index 3870e10a752a716da9a4dd7f7390e9dc94ee44d2..42213944405b686f726ae8c884f1aef794f8b6b7 100644 (file)
@@ -13,8 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-load_lib compiler-support.exp
-
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" "$testfile"] } {
index 031551e73359be889b368b42eda6b6563addffaa..3692d6815c4086a972185f42741611edeee65b04 100644 (file)
@@ -13,8 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-load_lib compiler-support.exp
-
 standard_testfile .c compile-setjmp-mod.c
 
 if { [prepare_for_testing "failed to prepare" $testfile] } {
index 09d9db8cc564e83035eb812e775f77e11a190549..7e52ad92a2fa115ee51a56e4e34853ad9a1a2d08 100644 (file)
@@ -13,8 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-load_lib compiler-support.exp
-
 standard_testfile .c
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
index 072129572ab7387e457e74a9e2fbe139f3d0499d..b2218704cb40fa599d76a68f88b769560d9c5c2d 100644 (file)
@@ -13,8 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-load_lib compiler-support.exp
-
 standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c
 
 get_compiler_info
index d0094846e36c292b505d57bd3370c83791fa9ad3..18bbab4d666e4d1b00e61ff5566464a3af1ea42a 100644 (file)
@@ -136,4 +136,3 @@ main (void)
     + A::stempmethod ()
     + A::stempmethod (0); // break here
 }
-
index a320d29f8cc7b6049865e3db23cad82494cadaa5..19eabe97595984284887058c5a080c9704671aaa 100644 (file)
@@ -15,7 +15,7 @@
 
 # Namespace-qualified template tests.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index 6ee1fbad25a91fb6de182e25bd6a2e58fa1be8f6..094c07be0c81233950ff66c82c543517314f7fbf 100644 (file)
@@ -15,7 +15,7 @@
 
 # (Very) simple method tests.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index f4561bc09dd1aac01d7e13cef33ec5da6d65c067..64c89064269780bd3732c1d9a47468f9090ce68f 100644 (file)
@@ -15,7 +15,7 @@
 
 # (Very) simple inheritance tests.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index 7fd734d8d00fcfddd0ca6bef374dceccedbbf70c..c9320d7c2f25589a72f2cea2fe9d4b32cc78f26f 100644 (file)
@@ -15,7 +15,7 @@
 
 # (Very) simple method tests.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index 506dca605bd7b048801c147143c1752fa807ef79..ebb1273b6cea914a5d243c5b5e833697cc706489 100644 (file)
@@ -15,7 +15,7 @@
 
 # (Very) simple method tests.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index 75d5e03d216e2537849c5b313e1cd8919403fd55..50db34f149431e8f6090a590fabbe35bd070add3 100644 (file)
@@ -56,4 +56,3 @@ main (void)
 
   return a.get ();
 }
-
index 74d3d6a962ab21852e5f08b7587d9ef48b23fea3..be3619740f428da0f7775e76c71b9c1dbd979beb 100644 (file)
@@ -15,7 +15,7 @@
 
 # (Very) simple virtual method/inheritance tests.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index 720c06efdb9ba5837b9910f12f95595ab58718eb..56923edba1441f2722e5288f393f906cca0107ab 100644 (file)
@@ -35,4 +35,3 @@ main (void)
   var += s.s4int_; /* break here */
   return S4::get_svar () - 10 * s.get_var ();
 }
-
index 216621bd1364e4ebebb29b988c6bac5deb340785..5d51a3d3d61b6dea7cb92e850f35b5ef10e2965f 100644 (file)
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index 706fda6acec5038cc84c502a75ed8cd37354a05d..ec46694757bb69474f5ed2f800c1384da73d6e41 100644 (file)
@@ -178,4 +178,3 @@ main (void)
     + defaultvals<int, 20> ()
     + deduct (0); // break here
 }
-
index 9919c24b42dff42871a7c27371991f91f596248c..7261eed332a77b5737425a2554ec8d11d788d346 100644 (file)
@@ -15,7 +15,7 @@
 
 # (Very) simple template tests.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index 264d6efb7736acd236d96eeb080a41e4fb368f48..f778d70a9b3efe0a5f2eb3776529b56d585896b2 100644 (file)
@@ -63,4 +63,3 @@ main (void)
 
   return 0;
 }
-
index f56fe0414fffd1c932ae1d1df1f8ce209bb90b40..44bb3dd725010499dda24b8d5ee4fe2f9ab92b84 100644 (file)
@@ -15,7 +15,7 @@
 
 # (Very) simple virtual method/inheritance tests.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index 26d4de5fbcf35f65debc75310d246af27c4f4fd6..fcbbfcea65ea1f07d7eb44df869b6440843799ad 100644 (file)
@@ -15,7 +15,7 @@
 
 # (Very) simple method tests.
 
-load_lib compiler-support.exp
+load_lib compile-support.exp
 
 standard_testfile .cc
 
index f2aab92d57397351affea0c94792580d844aa3cd..fcd3cfbfca119fe33381cf1142939e57e8e81f3c 100644 (file)
@@ -2026,7 +2026,7 @@ search_struct_method (const char *name, struct value **arg1p,
          /* Count the number of non-aliased/duplicated methods.  */
          for (k = 0; k < TYPE_FN_FIELDLIST_LENGTH (type, i); ++k)
            {
-             if (!TYPE_FN_FIELD_DUPLICATE (f, k))
+             if (!TYPE_FN_FIELD_ALIAS (f, k))
                ++j;
            }
          --j;
@@ -3442,14 +3442,14 @@ value_struct_elt_for_reference (struct type *domain, int offset,
              j = -1;
              for (ii = 0; ii < len; ++ii)
                {
-                 /* Skip artificial methods.  This is necessary if,
-                    for example, the user wants to "print
+                 /* Skip artificial and aliased methods.  This is necessary
+                    if, for example, the user wants to "print
                     subclass::subclass" with only one user-defined
                     constructor.  There is no ambiguity in this case.
                     We are careful here to allow artificial methods
                     if they are the unique result.  */
                  if (TYPE_FN_FIELD_ARTIFICIAL (f, ii)
-                     || TYPE_FN_FIELD_DUPLICATE (f, ii))
+                     || TYPE_FN_FIELD_ALIAS (f, ii))
                    {
                      if (j == -1)
                        j = ii;
@@ -3459,7 +3459,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
                  /* Desired method is ambiguous if more than one
                     method is defined.  */
                  if (j != -1 && !TYPE_FN_FIELD_ARTIFICIAL (f, j)
-                     && !TYPE_FN_FIELD_DUPLICATE (f, j))
+                     && !TYPE_FN_FIELD_ALIAS (f, j))
                    error (_("non-unique member `%s' requires "
                             "type instantiation"), name);