]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libcp1: revamp the interface
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 26 Jan 2017 21:33:42 +0000 (19:33 -0200)
committerAlexandre Oliva <aoliva@redhat.com>
Thu, 26 Jan 2017 21:33:42 +0000 (19:33 -0200)
Narrow the oracle lookups to identifiers only, unifying symbols and tags,
and dropping labels.  Adjust the gdb client code, pending simplification.

Rename most entry points into a more consistent naming scheme.  Adjust
the gdb client code.

Bump the interface version.

Comment out support for default args for functions.

Drop support for strong using directives, introduce simpler interface
for inline namespaces.

gdb/compile/compile-cplus-symbols.c
gdb/compile/compile-cplus-templates.c
gdb/compile/compile-cplus-types.c
gdb/compile/compile-cplus.h
include/gcc-cp-fe.def
include/gcc-cp-interface.h

index f33937b9ee2dac8299f86830c5cd39376744bfc7..2a9e91367c38a35afffca092184d7cb3293147fc 100644 (file)
@@ -266,13 +266,13 @@ convert_one_symbol (compile_cplus_instance *instance,
              struct template_symbol *tsymbol
                = (struct template_symbol *) sym.symbol;
 
-             instance->specialize_function_template (tsymbol, addr,
-                                                     filename, line);
+             instance->build_function_template_specialization (tsymbol, addr,
+                                                               filename, line);
            }
          else
            {
-             instance->new_decl ("variable", name.c_str (), kind, sym_type,
-                                 symbol_name, addr, filename, line);
+             instance->build_decl ("variable", name.c_str (), kind, sym_type,
+                                   symbol_name, addr, filename, line);
            }
 
          /* Pop scope for non-local symbols.  */
@@ -397,9 +397,9 @@ convert_symbol_bmsym (compile_cplus_instance *instance,
      information for the symbol.  While we have access to the demangled
      name, we still don't know what A::B::C::D::E::F means without debug
      info, no?  */
-  instance->new_decl ("minsym", MSYMBOL_NATURAL_NAME (msym), kind, sym_type,
-                     NULL, addr, NULL, 0);
-  instance->pop_namespace ("");
+  instance->build_decl ("minsym", MSYMBOL_NATURAL_NAME (msym), kind, sym_type,
+                       NULL, addr, NULL, 0);
+  instance->pop_binding_level ("");
 }
 
 /* Do a regular expression search of the symbol table for any symbol
@@ -471,7 +471,6 @@ gcc_cplus_convert_symbol (void *datum,
 {
   compile_cplus_instance *instance
     = (compile_cplus_instance *) datum;
-  domain_enum domain;
   int found = 0;
   struct search_multiple_result search_result;
   struct cleanup *cleanups;
@@ -479,14 +478,9 @@ gcc_cplus_convert_symbol (void *datum,
 
   switch (request)
     {
-    case GCC_CP_ORACLE_SYMBOL:
-      domain = VAR_DOMAIN;
-      break;
-    case GCC_CP_ORACLE_TAG:
-      domain = STRUCT_DOMAIN;
-      break;
-    case GCC_CP_ORACLE_LABEL:
-      domain = LABEL_DOMAIN;
+    case GCC_CP_ORACLE_IDENTIFIER:
+      /* FIXME: This used to be separate SYMBOL and TAG.  Check for
+        simplification opportunities below.  -lxo  */
       break;
     default:
       gdb_assert_not_reached ("Unrecognized oracle request.");
@@ -496,8 +490,7 @@ gcc_cplus_convert_symbol (void *datum,
      is to simply emit a gcc error.  */
   if (debug_compile_oracle)
     {
-      printf ("got oracle request for \"%s\" in domain %s\n", identifier,
-             domain_name (domain));
+      printf ("got oracle request for \"%s\"\n", identifier);
     }
 
   memset (&search_result, 0, sizeof (search_result));
@@ -522,11 +515,11 @@ gcc_cplus_convert_symbol (void *datum,
 
         4. Finally, if all else fails, fall back to minsyms.  */
 
-      if (domain == VAR_DOMAIN)
+      if (1)
        {
          search_result = search_symbols_multiple (identifier,
                                                   current_language,
-                                                  domain, NULL, NULL);
+                                                  VAR_DOMAIN, NULL, NULL);
          if (!VEC_empty (block_symbol_d, search_result.symbols))
            {
              struct block_symbol *elt;
@@ -539,7 +532,7 @@ gcc_cplus_convert_symbol (void *datum,
                   VEC_iterate (block_symbol_d, search_result.symbols, ix, elt);
                   ++ix)
                {
-                 convert_symbol_sym (instance, identifier, *elt, domain);
+                 convert_symbol_sym (instance, identifier, *elt, VAR_DOMAIN);
                }
              found = 1;
            }
@@ -549,10 +542,22 @@ gcc_cplus_convert_symbol (void *datum,
        {
          struct block_symbol sym;
 
-         sym = lookup_symbol (identifier, instance->block (), domain, NULL);
+         sym = lookup_symbol (identifier, instance->block (), VAR_DOMAIN, NULL);
+         if (sym.symbol != NULL)
+           {
+             convert_symbol_sym (instance, identifier, sym, VAR_DOMAIN);
+             found = 1;
+           }
+       }
+
+      if (1)
+       {
+         struct block_symbol sym;
+
+         sym = lookup_symbol (identifier, instance->block (), STRUCT_DOMAIN, NULL);
          if (sym.symbol != NULL)
            {
-             convert_symbol_sym (instance, identifier, sym, domain);
+             convert_symbol_sym (instance, identifier, sym, STRUCT_DOMAIN);
              found = 1;
            }
        }
@@ -560,7 +565,8 @@ gcc_cplus_convert_symbol (void *datum,
       if (!found)
        {
          /* Try a regexp search of the program's symbols.  */
-         found = regexp_search_symbols (instance, identifier, domain);
+         found = regexp_search_symbols (instance, identifier, VAR_DOMAIN)
+           + regexp_search_symbols (instance, identifier, STRUCT_DOMAIN);
 
          /* One last attempt: fall back to minsyms.  */
          if (!found && !VEC_empty (bound_minimal_symbol_d,
index f1922f932cfd883a99c5d5ee0cdcbb4efb870bf3..57658644a0ce477b31c7aa2a45765308af241cdb 100644 (file)
@@ -708,7 +708,7 @@ get_template_argument_value (compile_cplus_instance *instance,
     {
       /* !!keiths: More (incomplete) fun.  */
     case LOC_CONST:
-      value = instance->literal_expr (type, SYMBOL_VALUE (arg));
+      value = instance->build_literal_expr (type, SYMBOL_VALUE (arg));
       break;
 
     case LOC_COMPUTED:
@@ -728,7 +728,7 @@ get_template_argument_value (compile_cplus_instance *instance,
        /* !!keiths: This is a hack, but I don't want to write
           yet another linkage name translation function.  At least
           not just yet.  */
-       value = instance->literal_expr (type, value_address (val));
+       value = instance->build_literal_expr (type, value_address (val));
       }
       break;
 
@@ -772,7 +772,7 @@ define_template_parameters_generic
              }
 
            gcc_type abstract_type
-             = instance->new_template_typename_parm (id, is_pack,
+             = instance->build_type_template_parameter (id, is_pack,
                        default_type, filename, line);
            defn->set_parameter_abstract_type (i, abstract_type);
          }
@@ -795,8 +795,8 @@ define_template_parameters_generic
                                                 defn->default_argument (i));
              }
 
-           instance->new_template_value_parm (abstract_type, id,
-                                              default_value, filename, line);
+           instance->build_value_template_parameter (abstract_type, id,
+                                                     default_value, filename, line);
          }
          break;
 
@@ -1109,7 +1109,7 @@ class function_template_definer
 
     /* Start the new template declaration.  */
     m_instance->enter_scope (scope);
-    m_instance->start_new_template_decl (defn->generic ().c_str ());
+    m_instance->start_template_decl (defn->generic ().c_str ());
 
     /* Get the parameters' generic kinds and types.  */
     define_template_parameters_generic (m_instance, defn,
@@ -1280,10 +1280,10 @@ class function_template_definer
 
     /* Finally, define the new generic template declaration.  */
     gcc_decl decl
-      = m_instance->new_decl ("function template", name, sym_kind,
-                             func_type, 0, 0,
-                             symbol_symtab (&(tsym->base))->filename,
-                             SYMBOL_LINE (&(tsym->base)));
+      = m_instance->build_decl ("function template", name, sym_kind,
+                               func_type, 0, 0,
+                               symbol_symtab (&(tsym->base))->filename,
+                               SYMBOL_LINE (&(tsym->base)));
     defn->set_decl (decl);
 
     m_instance->leave_scope ();
@@ -1350,7 +1350,7 @@ class class_template_definer
     m_instance->enter_scope (scope);
 
     /* Start a new template list for this template.  */
-    m_instance->start_new_template_decl (defn->generic ().c_str ());
+    m_instance->start_template_decl (defn->generic ().c_str ());
 
     /* Get the parameters' generic kinds and types.  */
     define_template_parameters_generic (m_instance, defn, arg_info,
@@ -1365,11 +1365,11 @@ class class_template_definer
     if (TYPE_CODE (defn->type ()) == TYPE_CODE_STRUCT)
       {
        gcc_decl decl
-         = m_instance->new_decl ("class template", defn->decl_name (),
-                                 GCC_CP_SYMBOL_CLASS /* | nested_access? */
-                                 | (TYPE_DECLARED_CLASS (defn->type ())
-                                    ? GCC_CP_FLAG_CLASS_NOFLAG
-                                    : GCC_CP_FLAG_CLASS_IS_STRUCT),
+         = m_instance->build_decl ("class template", defn->decl_name (),
+                                   GCC_CP_SYMBOL_CLASS /* | nested_access? */
+                                   | (TYPE_DECLARED_CLASS (defn->type ())
+                                      ? GCC_CP_FLAG_CLASS_NOFLAG
+                                      : GCC_CP_FLAG_CLASS_IS_STRUCT),
                                  0, NULL, 0, /*filename*/ NULL, /*line*/ 0);
 
        defn->set_decl (decl);
@@ -1378,9 +1378,9 @@ class class_template_definer
       {
        gdb_assert (TYPE_CODE (defn->type ()) == TYPE_CODE_UNION);
        gcc_decl decl
-         = m_instance->new_decl ("union template", defn->decl_name (),
-                                 GCC_CP_SYMBOL_UNION /* | nested_access? */,
-                                 0, NULL, 0, /*fileanme*/NULL, /*line*/0);
+         = m_instance->build_decl ("union template", defn->decl_name (),
+                                   GCC_CP_SYMBOL_UNION /* | nested_access? */,
+                                   0, NULL, 0, /*fileanme*/NULL, /*line*/0);
 
        defn->set_decl (decl);
       }
index 973ea5a6ee30d0de2205fb1ddbcb7dd65a258362..7381e93826260636b0616846be389dd9ad3b4b38 100644 (file)
@@ -381,11 +381,11 @@ compile_cplus_instance::leave_scope ()
        (current.begin (),current.end () - 1, [this] (const auto &comp) {
          gdb_assert (TYPE_CODE (SYMBOL_TYPE (comp.bsymbol.symbol))
                      == TYPE_CODE_NAMESPACE);
-         this->pop_namespace (comp.name.c_str ());
+         this->pop_binding_level (comp.name.c_str ());
        });
 
       /* Pop global namespace.  */
-      pop_namespace ("");
+      pop_binding_level ("");
     }
   else
     {
@@ -595,12 +595,12 @@ ccp_convert_typedef (compile_cplus_instance *instance,
   /* Convert the typedef's real type.  */
   gcc_type typedef_type = instance->convert_type (check_typedef (type));
 
-  instance->new_decl ("typedef", name,
-                     GCC_CP_SYMBOL_TYPEDEF | nested_access,
-                     typedef_type,
-                     0, 0,
-                     /* !!keiths: Wow. More of this!  */
-                     NULL, 0);
+  instance->build_decl ("typedef", name,
+                       GCC_CP_SYMBOL_TYPEDEF | nested_access,
+                       typedef_type,
+                       0, 0,
+                       /* !!keiths: Wow. More of this!  */
+                       NULL, 0);
 
   /* Completed this scope.  */
   instance->leave_scope ();
@@ -676,11 +676,11 @@ ccp_convert_struct_or_union_members (compile_cplus_instance *instance,
              {
                physaddr = TYPE_FIELD_STATIC_PHYSADDR (type, i);
 
-               instance->new_decl ("field physaddr", field_name,
-                                   (GCC_CP_SYMBOL_VARIABLE
-                                    | get_field_access_flag (type, i)),
-                                   field_type, NULL, physaddr,
-                                   NULL, 0);
+               instance->build_decl ("field physaddr", field_name,
+                                     (GCC_CP_SYMBOL_VARIABLE
+                                      | get_field_access_flag (type, i)),
+                                     field_type, NULL, physaddr,
+                                     NULL, 0);
              }
              break;
 
@@ -702,11 +702,11 @@ ccp_convert_struct_or_union_members (compile_cplus_instance *instance,
                filename = symbol_symtab (sym.symbol)->filename;
                line = SYMBOL_LINE (sym.symbol);
                physaddr = SYMBOL_VALUE_ADDRESS (sym.symbol);
-               instance->new_decl ("field physname", field_name,
-                                   (GCC_CP_SYMBOL_VARIABLE
-                                    | get_field_access_flag (type, i)),
-                                   field_type, NULL, physaddr,
-                                   filename, line);
+               instance->build_decl ("field physname", field_name,
+                                     (GCC_CP_SYMBOL_VARIABLE
+                                      | get_field_access_flag (type, i)),
+                                     field_type, NULL, physaddr,
+                                     filename, line);
              }
              break;
 
@@ -733,8 +733,8 @@ ccp_convert_struct_or_union_members (compile_cplus_instance *instance,
          /* FIXME: We have to save the returned decl somewhere, so
             that we can refer to it in expressions, in context for
             lambdas, etc.  */
-         instance->new_field (field_name, field_type, field_flags,
-                              bitsize, TYPE_FIELD_BITPOS (type, i));
+         instance->build_field (field_name, field_type, field_flags,
+                                bitsize, TYPE_FIELD_BITPOS (type, i));
        }
     }
 }
@@ -1193,14 +1193,14 @@ ccp_convert_struct_or_union_methods (compile_cplus_instance *instance,
                    = ccp_convert_method (instance, type,
                                          TYPE_FN_FIELD_TYPE (methods, j));
 
-                 instance->new_decl("pure virtual method", name,
-                                    (sym_kind
-                                     | get_method_access_flag (type, i, j)
-                                     | GCC_CP_FLAG_VIRTUAL_FUNCTION
-                                     | GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION),
-                                    method_type, NULL, 0,
-                                    NULL /* FIXME: filename  */,
-                                    0 /* FIXME: line number  */);
+                 instance->build_decl("pure virtual method", name,
+                                      (sym_kind
+                                       | get_method_access_flag (type, i, j)
+                                       | GCC_CP_FLAG_VIRTUAL_FUNCTION
+                                       | GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION),
+                                      method_type, NULL, 0,
+                                      NULL /* FIXME: filename  */,
+                                      0 /* FIXME: line number  */);
                  do_cleanups (back_to);
                  continue;
                }
@@ -1230,8 +1230,8 @@ ccp_convert_struct_or_union_methods (compile_cplus_instance *instance,
              struct template_symbol *tsymbol
                = (struct template_symbol *) sym.symbol;
 
-             instance->specialize_function_template (tsymbol, address,
-                                                     filename, line);
+             instance->build_function_template_specialization (tsymbol, address,
+                                                               filename, line);
              do_cleanups (back_to);
              continue;
            }
@@ -1254,7 +1254,7 @@ ccp_convert_struct_or_union_methods (compile_cplus_instance *instance,
          if (TYPE_FN_FIELD_VIRTUAL_P (methods, j))
            sym_kind |= GCC_CP_FLAG_VIRTUAL_FUNCTION;
 
-         /* FIXME: for cdtors, we must call new_decl with a zero
+         /* FIXME: for cdtors, we must call build_decl with a zero
             address, if we haven't created the base declaration
             yet, and then define_cdtor_clone with the address of
             each clone.  When we leave the address out, GCC uses
@@ -1276,9 +1276,9 @@ ccp_convert_struct_or_union_methods (compile_cplus_instance *instance,
                }
            }
 
-         instance->new_decl (kind, name,
-                             sym_kind | get_method_access_flag (type, i, j),
-                             method_type, NULL, address, filename, line);
+         instance->build_decl (kind, name,
+                               sym_kind | get_method_access_flag (type, i, j),
+                               method_type, NULL, address, filename, line);
          do_cleanups (back_to);
        }
 
@@ -1334,24 +1334,24 @@ ccp_convert_struct_or_union (compile_cplus_instance *instance,
                      it go once we separate declaration from
                      definition (see below).  -lxo */
   if (TYPE_N_TEMPLATE_ARGUMENTS (type))
-    resuld = instance->specialize_class_template (type, filename, line);
+    resuld = instance->build_class_template_specialization (type, filename, line);
   else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
     {
       const char *what = TYPE_DECLARED_CLASS (type) ? "struct" : "class";
 
-      resuld = instance->new_decl (what, name,
-                                  GCC_CP_SYMBOL_CLASS | nested_access
-                                  | (TYPE_DECLARED_CLASS (type)
-                                     ? GCC_CP_FLAG_CLASS_NOFLAG
-                                     : GCC_CP_FLAG_CLASS_IS_STRUCT),
-                                  0, NULL, 0, filename, line);
+      resuld = instance->build_decl (what, name,
+                                    GCC_CP_SYMBOL_CLASS | nested_access
+                                    | (TYPE_DECLARED_CLASS (type)
+                                       ? GCC_CP_FLAG_CLASS_NOFLAG
+                                       : GCC_CP_FLAG_CLASS_IS_STRUCT),
+                                    0, NULL, 0, filename, line);
     }
   else
     {
       gdb_assert (TYPE_CODE (type) == TYPE_CODE_UNION);
-      resuld = instance->new_decl ("union", name,
-                                  GCC_CP_SYMBOL_UNION | nested_access,
-                                  0, NULL, 0, filename, line);
+      resuld = instance->build_decl ("union", name,
+                                    GCC_CP_SYMBOL_UNION | nested_access,
+                                    0, NULL, 0, filename, line);
     }
 
   /* FIXME: we should be able to pop the scope at this point, rather
@@ -1386,8 +1386,8 @@ ccp_convert_struct_or_union (compile_cplus_instance *instance,
            }
        }
 
-      result = instance->start_class_definition (name, resuld, &bases,
-                                                filename, line);
+      result = instance->start_class_type (name, resuld, &bases,
+                                          filename, line);
       xfree (bases.flags);
       xfree (bases.elements);
     }
@@ -1395,8 +1395,8 @@ ccp_convert_struct_or_union (compile_cplus_instance *instance,
     {
       gdb_assert (TYPE_CODE (type) == TYPE_CODE_UNION);
       result
-       = instance->start_class_definition (name, resuld, NULL,
-                                           filename, line);
+       = instance->start_class_type (name, resuld, NULL,
+                                     filename, line);
     }
 
   instance->insert_type (type, result);
@@ -1411,7 +1411,7 @@ ccp_convert_struct_or_union (compile_cplus_instance *instance,
   ccp_convert_struct_or_union_members (instance, type, result);
 
   /* All finished.  */
-  instance->finish_record_or_union (name, TYPE_LENGTH (type));
+  instance->finish_class_type (name, TYPE_LENGTH (type));
 
   /* Pop all scopes.  */
   instance->leave_scope ();
@@ -1454,15 +1454,15 @@ ccp_convert_enum (compile_cplus_instance *instance, struct type *type,
   /* Push all scopes.  */
   instance->enter_scope (scope);
 
-  int_type = instance->int_type (TYPE_UNSIGNED (type),
-                                TYPE_LENGTH (type), NULL);
+  int_type = instance->get_int_type (TYPE_UNSIGNED (type),
+                                    TYPE_LENGTH (type), NULL);
   gcc_type result
-    = instance->start_new_enum_type (name, int_type,
-                                    GCC_CP_SYMBOL_ENUM | nested_access
-                                    | (scoped_enum_p
-                                       ? GCC_CP_FLAG_ENUM_SCOPED
-                                       : GCC_CP_FLAG_ENUM_NOFLAG),
-                                    filename, line);
+    = instance->start_enum_type (name, int_type,
+                                GCC_CP_SYMBOL_ENUM | nested_access
+                                | (scoped_enum_p
+                                   ? GCC_CP_FLAG_ENUM_SCOPED
+                                   : GCC_CP_FLAG_ENUM_NOFLAG),
+                                filename, line);
   for (i = 0; i < TYPE_NFIELDS (type); ++i)
     {
       char *fname = cp_func_name (TYPE_FIELD_NAME (type, i));
@@ -1474,8 +1474,8 @@ ccp_convert_enum (compile_cplus_instance *instance, struct type *type,
          continue;
        }
 
-      instance->build_add_enum_constant (result, fname,
-                                        TYPE_FIELD_ENUMVAL (type, i));
+      instance->build_enum_constant (result, fname,
+                                    TYPE_FIELD_ENUMVAL (type, i));
       xfree (fname);
     }
 
@@ -1539,11 +1539,11 @@ ccp_convert_int (compile_cplus_instance *instance, struct type *type)
   if (TYPE_NOSIGN (type))
     {
       gdb_assert (TYPE_LENGTH (type) == 1);
-      return instance->char_type ();
+      return instance->get_char_type ();
     }
 
-  return instance->int_type (TYPE_UNSIGNED (type), TYPE_LENGTH (type),
-                            TYPE_NAME (type));
+  return instance->get_int_type (TYPE_UNSIGNED (type), TYPE_LENGTH (type),
+                                TYPE_NAME (type));
 }
 
 /* Convert a floating-point type to its gcc representation.  */
@@ -1551,7 +1551,7 @@ ccp_convert_int (compile_cplus_instance *instance, struct type *type)
 static gcc_type
 ccp_convert_float (compile_cplus_instance *instance, struct type *type)
 {
-  return instance->float_type (TYPE_LENGTH (type), TYPE_NAME (type));
+  return instance->get_float_type (TYPE_LENGTH (type), TYPE_NAME (type));
 }
 
 /* Convert the 'void' type to its gcc representation.  */
@@ -1559,7 +1559,7 @@ ccp_convert_float (compile_cplus_instance *instance, struct type *type)
 static gcc_type
 ccp_convert_void (compile_cplus_instance *instance, struct type *type)
 {
-  return instance->void_type ();
+  return instance->get_void_type ();
 }
 
 /* Convert a boolean type to its gcc representation.  */
@@ -1567,7 +1567,7 @@ ccp_convert_void (compile_cplus_instance *instance, struct type *type)
 static gcc_type
 ccp_convert_bool (compile_cplus_instance *instance, struct type *type)
 {
-  return instance->bool_type ();
+  return instance->get_bool_type ();
 }
 
 /* See description in compile-cplus.h.  */
@@ -1643,7 +1643,7 @@ ccp_convert_namespace (compile_cplus_instance *instance,
 
   /* Convert this namespace.  */
   instance->push_namespace (name);
-  instance->pop_namespace (name);
+  instance->pop_binding_level (name);
 
   /* Pop scope.  */
   instance->leave_scope ();
@@ -1837,7 +1837,7 @@ compile_cplus_instance::build_constant (gcc_type type, const char *name,
 /* See description in gcc-cp-fe.def.  */
 
 gcc_decl
-compile_cplus_instance::specialize_function_template
+compile_cplus_instance::build_function_template_specialization
   (struct template_symbol *concrete, gcc_address address,
    const char *filename, unsigned int line_number)
 {
@@ -1858,7 +1858,7 @@ compile_cplus_instance::specialize_function_template
   make_cleanup (xfree, targs.elements);
   enumerate_template_arguments (&targs, defn, concrete->template_arguments);
 
-  DECLARE_FORWARD (specialize_function_template, defn->decl (), &targs,
+  DECLARE_FORWARD (build_function_template_specialization, defn->decl (), &targs,
                   address, filename, line_number);
 
   gcc_decl result = forward ("%s", SYMBOL_NATURAL_NAME (&concrete->base));
@@ -1869,9 +1869,9 @@ compile_cplus_instance::specialize_function_template
 /* See description in gcc-cp-fe.def.  */
 
 gcc_decl
-compile_cplus_instance::specialize_class_template (struct type *concrete,
-                                                  const char *filename,
-                                                  unsigned int line_number)
+compile_cplus_instance::build_class_template_specialization (struct type *concrete,
+                                                            const char *filename,
+                                                            unsigned int line_number)
 {
   class_template_defn *defn
     = find_class_template_defn (concrete);
@@ -1891,7 +1891,7 @@ compile_cplus_instance::specialize_class_template (struct type *concrete,
   enumerate_template_arguments (&targs, defn,
                                TYPE_TEMPLATE_ARGUMENT_INFO (concrete));
 
-  DECLARE_FORWARD (specialize_class_template, defn->decl (), &targs,
+  DECLARE_FORWARD (build_class_template_specialization, defn->decl (), &targs,
                   filename, line_number);
 
   gcc_decl result
@@ -1904,15 +1904,15 @@ compile_cplus_instance::specialize_class_template (struct type *concrete,
 /* See description in gcc-cp-fe.def.  */
 
 gcc_decl
-compile_cplus_instance::new_decl (const char *decl_type,
-                                 const char *name,
-                                 enum gcc_cp_symbol_kind sym_kind,
-                                 gcc_type sym_type,
-                                 const char *substitution_name,
-                                 gcc_address address, const char *filename,
-                                 unsigned int line_number)
-{
-  DECLARE_FORWARD (new_decl, name, sym_kind, sym_type,
+compile_cplus_instance::build_decl (const char *decl_type,
+                                   const char *name,
+                                   enum gcc_cp_symbol_kind sym_kind,
+                                   gcc_type sym_type,
+                                   const char *substitution_name,
+                                   gcc_address address, const char *filename,
+                                   unsigned int line_number)
+{
+  DECLARE_FORWARD (build_decl, name, sym_kind, sym_type,
                   substitution_name, address, filename, line_number);
 
   return forward ("%s %s %d %s", decl_type, name, (int) sym_kind,
@@ -1932,9 +1932,9 @@ compile_cplus_instance::push_namespace (const char *name)
 /* See description in gcc-cp-fe.def.  */
 
 bool
-compile_cplus_instance::pop_namespace (const char *opt_name)
+compile_cplus_instance::pop_binding_level (const char *opt_name)
 {
-  DECLARE_FORWARD (pop_namespace);
+  DECLARE_FORWARD (pop_binding_level);
 
   return forward ("\"%s\"", opt_name);
 }
@@ -2007,11 +2007,11 @@ compile_cplus_instance::build_array_type (gcc_type element_type,
 /* See description in gcc-cp-fe.def.  */
 
 gcc_decl
-compile_cplus_instance::new_field (const char *field_name, gcc_type field_type,
-                                  enum gcc_cp_symbol_kind field_flags,
-                                  unsigned long bitsize, unsigned long bitpos)
+compile_cplus_instance::build_field (const char *field_name, gcc_type field_type,
+                                    enum gcc_cp_symbol_kind field_flags,
+                                    unsigned long bitsize, unsigned long bitpos)
 {
-  DECLARE_FORWARD (new_field, field_name, field_type, field_flags,
+  DECLARE_FORWARD (build_field, field_name, field_type, field_flags,
                   bitsize, bitpos);
 
   return forward ("%s %lld", field_name, field_type);
@@ -2033,12 +2033,12 @@ compile_cplus_instance::build_method_type (gcc_type class_type,
 /* See description in gcc-cp-fe.def.  */
 
 gcc_type
-compile_cplus_instance::start_class_definition
+compile_cplus_instance::start_class_type
   (const char *name, gcc_decl typedecl,
    const struct gcc_vbase_array *base_classes,
    const char *filename, unsigned int line_number)
 {
-  DECLARE_FORWARD (start_class_definition, typedecl, base_classes,
+  DECLARE_FORWARD (start_class_type, typedecl, base_classes,
                   filename, line_number);
 
   return forward ("%s", name);
@@ -2047,10 +2047,10 @@ compile_cplus_instance::start_class_definition
 /* See description in gcc-cp-fe.def.  */
 
 bool
-compile_cplus_instance::finish_record_or_union (const char *name,
-                                               unsigned long size_in_bytes)
+compile_cplus_instance::finish_class_type (const char *name,
+                                          unsigned long size_in_bytes)
 {
-  DECLARE_FORWARD (finish_record_or_union, size_in_bytes);
+  DECLARE_FORWARD (finish_class_type, size_in_bytes);
 
   return forward ("%s (%ld)", name, size_in_bytes);
 }
@@ -2058,10 +2058,10 @@ compile_cplus_instance::finish_record_or_union (const char *name,
 /* See description in gcc-cp-fe.def.  */
 
 gcc_type
-compile_cplus_instance::int_type (bool is_unsigned, unsigned long size_in_bytes,
-                                 const char *builtin_name)
+compile_cplus_instance::get_int_type (bool is_unsigned, unsigned long size_in_bytes,
+                                     const char *builtin_name)
 {
-  DECLARE_FORWARD (int_type, is_unsigned, size_in_bytes, builtin_name);
+  DECLARE_FORWARD (get_int_type, is_unsigned, size_in_bytes, builtin_name);
 
   return forward ("%d %ld %s", is_unsigned, size_in_bytes, builtin_name);
 }
@@ -2069,13 +2069,13 @@ compile_cplus_instance::int_type (bool is_unsigned, unsigned long size_in_bytes,
 /* See description in gcc-cp-fe.def.  */
 
 gcc_type
-compile_cplus_instance::start_new_enum_type (const char *name,
-                                            gcc_type underlying_int_type,
-                                            enum gcc_cp_symbol_kind flags,
-                                            const char *filename,
-                                            unsigned int line_number)
+compile_cplus_instance::start_enum_type (const char *name,
+                                        gcc_type underlying_int_type,
+                                        enum gcc_cp_symbol_kind flags,
+                                        const char *filename,
+                                        unsigned int line_number)
 {
-  DECLARE_FORWARD (start_new_enum_type, name, underlying_int_type,
+  DECLARE_FORWARD (start_enum_type, name, underlying_int_type,
                   flags, filename, line_number);
 
   return forward ("%s", name);
@@ -2084,11 +2084,11 @@ compile_cplus_instance::start_new_enum_type (const char *name,
 /* See description in gcc-cp-fe.def.  */
 
 gcc_decl
-compile_cplus_instance::build_add_enum_constant (gcc_type enum_type,
-                                                const char *name,
-                                                unsigned long value)
+compile_cplus_instance::build_enum_constant (gcc_type enum_type,
+                                            const char *name,
+                                            unsigned long value)
 {
-  DECLARE_FORWARD (build_add_enum_constant, enum_type, name, value);
+  DECLARE_FORWARD (build_enum_constant, enum_type, name, value);
 
   return forward ("%s = %ld", name, value);
 }
@@ -2119,9 +2119,9 @@ compile_cplus_instance::build_function_type
 /* See description in gcc-cp-fe.def.  */
 
 gcc_type
-compile_cplus_instance::char_type ()
+compile_cplus_instance::get_char_type ()
 {
-  DECLARE_FORWARD (char_type);
+  DECLARE_FORWARD (get_char_type);
 
   return forward ("");
 }
@@ -2129,10 +2129,10 @@ compile_cplus_instance::char_type ()
 /* See description in gcc-cp-fe.def.  */
 
 gcc_type
-compile_cplus_instance::float_type (unsigned long size_in_bytes,
-                                   const char *builtin_name)
+compile_cplus_instance::get_float_type (unsigned long size_in_bytes,
+                                       const char *builtin_name)
 {
-  DECLARE_FORWARD (float_type, size_in_bytes, builtin_name);
+  DECLARE_FORWARD (get_float_type, size_in_bytes, builtin_name);
 
   return forward  ("%ld %s", size_in_bytes, builtin_name);
 }
@@ -2140,9 +2140,9 @@ compile_cplus_instance::float_type (unsigned long size_in_bytes,
 /* See description in gcc-cp-fe.def.  */
 
 gcc_type
-compile_cplus_instance::void_type ()
+compile_cplus_instance::get_void_type ()
 {
-  DECLARE_FORWARD (void_type);
+  DECLARE_FORWARD (get_void_type);
 
   return forward ("");
 }
@@ -2150,9 +2150,9 @@ compile_cplus_instance::void_type ()
 /* See description in gcc-cp-fe.def.  */
 
 gcc_type
-compile_cplus_instance::bool_type ()
+compile_cplus_instance::get_bool_type ()
 {
-  DECLARE_FORWARD (bool_type);
+  DECLARE_FORWARD (get_bool_type);
 
   return forward ("");
 }
@@ -2181,9 +2181,9 @@ compile_cplus_instance::build_complex_type (gcc_type element_type)
 /* See description in gcc-cp-fe.def.  */
 
 gcc_expr
-compile_cplus_instance::literal_expr (gcc_type type, unsigned long value)
+compile_cplus_instance::build_literal_expr (gcc_type type, unsigned long value)
 {
-  DECLARE_FORWARD (literal_expr, type, value);
+  DECLARE_FORWARD (build_literal_expr, type, value);
 
   return forward ("%lld %ld", type, value);
 }
@@ -2191,12 +2191,12 @@ compile_cplus_instance::literal_expr (gcc_type type, unsigned long value)
 /* See description in gcc-cp-fe.def.  */
 
 gcc_type
-compile_cplus_instance::new_template_typename_parm (const char *id, bool pack_p,
-                                                   gcc_type default_type,
-                                                   const char *filename,
-                                                   unsigned int line_number)
+compile_cplus_instance::build_type_template_parameter (const char *id, bool pack_p,
+                                                      gcc_type default_type,
+                                                      const char *filename,
+                                                      unsigned int line_number)
 {
-  DECLARE_FORWARD (new_template_typename_parm, id, pack_p,
+  DECLARE_FORWARD (build_type_template_parameter, id, pack_p,
                   default_type, filename, line_number);
 
   return forward ("%s %d %lld %s %d", id, pack_p, default_type,
@@ -2206,12 +2206,12 @@ compile_cplus_instance::new_template_typename_parm (const char *id, bool pack_p,
 /* See description in gcc-cp-fe.def.  */
 
 gcc_decl
-compile_cplus_instance::new_template_value_parm (gcc_type type, const char *id,
-                                                gcc_expr default_value,
-                                                const char *filename,
-                                                unsigned int line_number)
+compile_cplus_instance::build_value_template_parameter (gcc_type type, const char *id,
+                                                       gcc_expr default_value,
+                                                       const char *filename,
+                                                       unsigned int line_number)
 {
-  DECLARE_FORWARD (new_template_value_parm, type, id,
+  DECLARE_FORWARD (build_value_template_parameter, type, id,
                   default_value, filename, line_number);
 
   return forward ("%lld %s %lld %s %d", type, id, default_value,
@@ -2221,9 +2221,9 @@ compile_cplus_instance::new_template_value_parm (gcc_type type, const char *id,
 /* See description in gcc-cp-fe.def.  */
 
 bool
-compile_cplus_instance::start_new_template_decl (const char *generic)
+compile_cplus_instance::start_template_decl (const char *generic)
 {
-  DECLARE_FORWARD (start_new_template_decl);
+  DECLARE_FORWARD (start_template_decl);
 
   return forward ("for generic %s\n", generic);
 }
index a633fb8687d71dfb79695f32790261de53037460..5d7a7b67777e9d3d64cc88aaf33d571c83481484 100644 (file)
@@ -185,10 +185,10 @@ namespace compile
     /* !!keiths: YUCK!
        Plug-in forwards  */
 
-    gcc_type bool_type ();
+    gcc_type get_bool_type ();
 
-    gcc_decl build_add_enum_constant (gcc_type enum_type, const char *name,
-                                     unsigned long value);
+    gcc_decl build_enum_constant (gcc_type enum_type, const char *name,
+                                 unsigned long value);
 
     gcc_type build_array_type (gcc_type element_type, int num_elements);
 
@@ -221,73 +221,73 @@ namespace compile
 
     gcc_type build_vector_type (gcc_type element_type, int num_elements);
 
-    gcc_type char_type ();
+    gcc_type get_char_type ();
 
     gcc_type error (const char *message);
 
     bool finish_enum_type (gcc_type enum_type);
 
     /* NAME for debugging  */
-    bool finish_record_or_union (const char *name, unsigned long size_in_bytes);
+    bool finish_class_type (const char *name, unsigned long size_in_bytes);
 
-    gcc_type float_type (unsigned long size_in_bytes, const char *builtin_name);
+    gcc_type get_float_type (unsigned long size_in_bytes, const char *builtin_name);
 
-    gcc_type int_type (bool is_unsigned, unsigned long size_in_bytes,
+    gcc_type get_int_type (bool is_unsigned, unsigned long size_in_bytes,
                       const char *builtin_name);
 
-    gcc_expr literal_expr (gcc_type type, unsigned long value);
+    gcc_expr build_literal_expr (gcc_type type, unsigned long value);
 
     /* DECL_DESC for debugging only  */
-    gcc_decl new_decl (const char *decl_desc, const char *name,
-                      enum gcc_cp_symbol_kind sym_kind,
-                      gcc_type sym_type, const char *substitution_name,
-                      gcc_address address,
-                      const char *filename, unsigned int line_number);
-
-    gcc_decl new_field (const char *field_name, gcc_type field_type,
-                       enum gcc_cp_symbol_kind field_flags,
-                       unsigned long bitsize, unsigned long bitpos);
-
-    gcc_type new_template_typename_parm (const char *id, bool pack_p,
-                                        gcc_type default_type,
-                                        const char *filename,
-                                        unsigned int line_number);
-
-    gcc_decl new_template_value_parm (gcc_type type, const char *id,
-                                     gcc_expr default_value,
-                                     const char *filename,
-                                     unsigned int line_number);
+    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,
+                        gcc_address address,
+                        const char *filename, unsigned int line_number);
+
+    gcc_decl build_field (const char *field_name, gcc_type field_type,
+                         enum gcc_cp_symbol_kind field_flags,
+                         unsigned long bitsize, unsigned long bitpos);
+
+    gcc_type build_type_template_parameter (const char *id, bool pack_p,
+                                           gcc_type default_type,
+                                           const char *filename,
+                                           unsigned int line_number);
+
+    gcc_decl build_value_template_parameter (gcc_type type, const char *id,
+                                            gcc_expr default_value,
+                                            const char *filename,
+                                            unsigned int line_number);
 
     /* NAME is for debugging only  */
-    bool pop_namespace (const char *name);
+    bool pop_binding_level (const char *name);
 
     bool push_namespace (const char *name);
 
-    gcc_decl specialize_class_template (struct type *concrete,
-                                       const char *filename,
-                                       unsigned int line_number);
+    gcc_decl build_class_template_specialization (struct type *concrete,
+                                                 const char *filename,
+                                                 unsigned int line_number);
 
-    gcc_decl specialize_function_template (struct template_symbol *concrete,
-                                          gcc_address address,
-                                          const char *filename,
-                                          unsigned int line_number);
+    gcc_decl build_function_template_specialization (struct template_symbol *concrete,
+                                                    gcc_address address,
+                                                    const char *filename,
+                                                    unsigned int line_number);
 
     /* NAME only for debugging  */
-    gcc_type start_class_definition (const char *name, gcc_decl typedecl,
-                                    const struct gcc_vbase_array *base_classes,
-                                    const char *filename,
-                                    unsigned int line_number);
+    gcc_type start_class_type (const char *name, gcc_decl typedecl,
+                              const struct gcc_vbase_array *base_classes,
+                              const char *filename,
+                              unsigned int line_number);
 
-    gcc_type start_new_enum_type (const char *name,
-                                 gcc_type underlying_int_type,
-                                 enum gcc_cp_symbol_kind flags,
-                                 const char *filename,
-                                 unsigned int line_number);
+    gcc_type start_enum_type (const char *name,
+                             gcc_type underlying_int_type,
+                             enum gcc_cp_symbol_kind flags,
+                             const char *filename,
+                             unsigned int line_number);
 
     /* GENERIC only for debugging  */
-    bool start_new_template_decl (const char *generic);
+    bool start_template_decl (const char *generic);
 
-    gcc_type void_type ();
+    gcc_type get_void_type ();
 
 
   private:
index 7fcd484cee77a1974384ec5a69dc878524a9aba9..f6d0a41d98d6889253332728c46fb0a7e1053de7 100644 (file)
@@ -1,6 +1,6 @@
 /* Interface between GCC C++ FE and GDB  -*- c -*-
 
-   Copyright (C) 2014-2016 Free Software Foundation, Inc.
+   Copyright (C) 2014-2017 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
    namespace.  A namespace named NAME is created in the current scope,
    if needed.
 
-   If the newly-created namespace is to be an inline namespace, after
-   push_namespace, get the nested namespace decl with
-   get_current_binding_level, pop back to the enclosing namespace,
-   call using_namespace with INLINE_P, and then push to the inline
-   namespace again.  */
+   If the newly-created namespace is to be an inline namespace, see
+   make_namespace_inline.  */
 
 GCC_METHOD1 (int /* bool */, push_namespace,
             const char *)            /* Argument NAME.  */
@@ -151,8 +148,8 @@ GCC_METHOD1 (int /* bool */, push_function,
    scope will have to be reentered in order to define the class.
 
 .  If the code snippet is at point 2, we don't need to (re)activate
-   anything declaration: nothing from any local scope is visible.
-   Just entering the scope of the class containing member function f
+   any declaration: nothing from any local scope is visible.  Just
+   entering the scope of the class containing member function f
    reactivates the names of its members, including the class name
    itself.  */
 
@@ -165,22 +162,26 @@ GCC_METHOD2 (int /* bool */, reactivate_decl,
    push_function, restoring the binding level in effect before the
    matching push_* call.  */
 
-GCC_METHOD0 (int /* bool */, pop_namespace)
+GCC_METHOD0 (int /* bool */, pop_binding_level)
 
 /* Return the NAMESPACE_DECL, TYPE_DECL or FUNCTION_DECL of the
-   binding level that would be popped by pop_namespace.  */
+   binding level that would be popped by pop_scope.  */
 
-GCC_METHOD0 (gcc_decl, get_current_binding_level)
+GCC_METHOD0 (gcc_decl, get_current_binding_level_decl)
+
+/* Make the current binding level an inline namespace.  It must be a
+   namespace to begin with.  It is safe to call this more than once
+   for the same namespace, but after the first call, subsequent ones
+   will not return a success status.  */
+
+GCC_METHOD0 (int /* bool */, make_namespace_inline)
 
 /* Add USED_NS to the namespaces used by the current binding level.
-   Use get_current_binding_level to obtain USED_NS's gcc_decl.
-   INLINE_P indicates USED_NS was declared as an inline namespace, or
-   the presence of attribute strong in the using directive, which
-   is an older but equivalent GCC extension.  */
+   Use get_current_binding_level_decl to obtain USED_NS's
+   gcc_decl.  */
 
-GCC_METHOD2 (int /* bool */, using_namespace,
-            gcc_decl,                  /* Argument USED_NS.  */
-            int /* bool */)            /* Argument INLINE_P.  */
+GCC_METHOD1 (int /* bool */, add_using_namespace,
+            gcc_decl)                  /* Argument USED_NS.  */
 
 /* Introduce a namespace alias declaration, as in:
 
@@ -188,9 +189,9 @@ GCC_METHOD2 (int /* bool */, using_namespace,
 
    After this call, namespace TARGET will be visible as ALIAS within
    the current namespace.  Get the declaration for TARGET by calling
-   get_current_binding_level after pushing into it.  */
+   get_current_binding_level_decl after pushing into it.  */
 
-GCC_METHOD2 (int /* bool */, new_namespace_alias,
+GCC_METHOD2 (int /* bool */, add_namespace_alias,
             const char *,              /* Argument ALIAS.  */
             gcc_decl)                  /* Argument TARGET.  */
 
@@ -209,9 +210,9 @@ GCC_METHOD2 (int /* bool */, new_namespace_alias,
    Even when TARGET is template dependent, we don't need to specify
    whether or not it is a typename: the supplied declaration (that
    could be a template-dependent type converted to declaration by
-   type_decl) indicates so.  */
+   get_type_decl) indicates so.  */
 
-GCC_METHOD2 (int /* bool */, new_using_decl,
+GCC_METHOD2 (int /* bool */, add_using_decl,
             enum gcc_cp_symbol_kind, /* Argument FLAGS.  */
             gcc_decl)                /* Argument TARGET.  */
 
@@ -232,6 +233,9 @@ GCC_METHOD2 (int /* bool */, new_using_decl,
    Use this function to register typedefs, functions and variables to
    namespace and local binding levels, and typedefs, member functions
    (static or not), and static data members to class binding levels.
+   Class members must have their access controls specified with
+   GCC_CP_ACCESS_* flags in SYM_KIND.
+
    Note that, since access controls are disabled, we have no means to
    express private, protected and public.
 
@@ -264,18 +268,18 @@ GCC_METHOD2 (int /* bool */, new_using_decl,
 
    Constructors and destructors need special care, because for each
    constructor and destructor there may be multiple clones defined
-   internally by the compiler.  With new_decl, you can introduce the
+   internally by the compiler.  With build_decl, you can introduce the
    base declaration of a constructor or a destructor, setting
    GCC_CP_FLAG_SPECIAL_FUNCTION the flag and using names starting with
    capital "C" or "D", respectively, followed by a digit (see below),
    a blank, or NUL ('\0').  DO NOT supply an ADDRESS or a
-   SUBSTITUTION_NAME to new_decl, it would be meaningless (and
+   SUBSTITUTION_NAME to build_decl, it would be meaningless (and
    rejected) for the base declaration; use define_cdtor_clone to
    introduce the address of each clone.  For constructor templates,
-   declare the template with new_decl, and then, for each
-   specialization, introduce it with specialize_function_template, and
-   then define the addresses of each of its clones with
-   define_cdtor_clone.
+   declare the template with build_decl, and then, for each
+   specialization, introduce it with
+   build_function_template_specialization, and then define the
+   addresses of each of its clones with define_cdtor_clone.
 
    NAMEs for GCC_CP_FLAG_SPECIAL_FUNCTION:
 
@@ -334,7 +338,7 @@ GCC_METHOD2 (int /* bool */, new_using_decl,
 
    FIXME: How about attributes?  */
 
-GCC_METHOD7 (gcc_decl, new_decl,
+GCC_METHOD7 (gcc_decl, build_decl,
             const char *,            /* Argument NAME.  */
             enum gcc_cp_symbol_kind, /* Argument SYM_KIND.  */
             gcc_type,                /* Argument SYM_TYPE.  */
@@ -344,8 +348,8 @@ GCC_METHOD7 (gcc_decl, new_decl,
             unsigned int)            /* Argument LINE_NUMBER.  */
 
 /* Supply the ADDRESS of one of the multiple clones of constructor or
-   destructor CDTOR.  The clone is selected using the following
-   name mangling conventions:
+   destructor CDTOR.  The clone is specified by NAME, using the
+   following name mangling conventions:
 
      C1      in-charge constructor
      C2      not-in-charge constructor
@@ -372,8 +376,8 @@ GCC_METHOD7 (gcc_decl, new_decl,
    The [CD]4 manglings (and symbol definitions) are non-standard, but
    GCC uses them in some cases: rather than assuming they are
    in-charge or not-in-charge, they test the implicit argument that
-   the others ignore to tell how to behave.  These are defined in very
-   rare cases of virtual inheritance and cdtor prototypes.  */
+   the others ignore to tell how to behave.  These are used instead of
+   cloning when we just can't use aliases.  */
 
 GCC_METHOD3 (gcc_decl, define_cdtor_clone,
             const char *,            /* Argument NAME.  */
@@ -383,18 +387,18 @@ GCC_METHOD3 (gcc_decl, define_cdtor_clone,
 /* Return the type associated with the given declaration.  This is
    most useful to obtain the type associated with a forward-declared
    class, because it is the gcc_type, rather than the gcc_decl, that
-   has to be used to build other types, but new_decl returns a
+   has to be used to build other types, but build_decl returns a
    gcc_decl rather than a gcc_type.  This call can in theory be used
    to obtain the type from any other declaration; it is supposed to
    return the same type that was supplied when the declaration was
    created.  */
 
-GCC_METHOD1 (gcc_type, decl_type,
+GCC_METHOD1 (gcc_type, get_decl_type,
             gcc_decl)            /* Argument DECL.  */
 
 /* Return the declaration for a type.  */
 
-GCC_METHOD1 (gcc_decl, type_decl,
+GCC_METHOD1 (gcc_decl, get_type_decl,
             gcc_type)            /* Argument TYPE.  */
 
 /* Declare DECL as a friend of the current class scope, if TYPE is
@@ -437,11 +441,11 @@ GCC_METHOD1 (gcc_decl, type_decl,
 
    In order to simplify such friend declarations, and to enable
    incremental friend declarations as template specializations are
-   introduced, new_friend can be called after the befriended class is
+   introduced, new_friend can be called after the befriending class is
    fully defined, passing it a non-NULL TYPE argument naming the
-   befriended class type.  */
+   befriending class type.  */
 
-GCC_METHOD2 (int /* bool */, new_friend,
+GCC_METHOD2 (int /* bool */, add_friend,
             gcc_decl,                /* Argument DECL.  */
             gcc_type)                /* Argument TYPE.  */
 
@@ -467,14 +471,14 @@ GCC_METHOD2 (gcc_type, build_pointer_to_member_type,
             gcc_type)                     /* Argument MEMBER_TYPE.  */
 
 /* Start a template parameter list, so that subsequent
-   build_template_typename_parm and build_template_value_parm calls
-   create template parameters in the list.  The list is closed by a
-   new_decl call with GCC_CP_SYMBOL_FUNCTION or GCC_CP_SYMBOL_CLASS,
-   that, when the scope is a template parameter list, closes the
-   parameter list and declares a template function or a template class
-   with the parameter list.  */
+   build_type_template_parameter and build_value_template_parameter
+   calls create template parameters in the list.  The list is closed
+   by a build_decl call with GCC_CP_SYMBOL_FUNCTION or
+   GCC_CP_SYMBOL_CLASS, that, when the scope is a template parameter
+   list, closes the parameter list and declares a template function or
+   a template class with the parameter list.  */
 
-GCC_METHOD0 (int /* bool */, start_new_template_decl)
+GCC_METHOD0 (int /* bool */, start_template_decl)
 
 /* Build a typename template-parameter (e.g., the T in template
    <typename T = X>).  Either PACK_P should be nonzero, to indicate an
@@ -484,7 +488,7 @@ GCC_METHOD0 (int /* bool */, start_new_template_decl)
    parameter.  FILENAME and LINE_NUMBER may specify the source
    location in which the template parameter was declared.  */
 
-GCC_METHOD5 (gcc_type, new_template_typename_parm,
+GCC_METHOD5 (gcc_type, build_type_template_parameter,
             const char *,                            /* Argument ID.  */
             int /* bool */,                      /* Argument PACK_P.  */
             gcc_type,                      /* Argument DEFAULT_TYPE.  */
@@ -497,7 +501,7 @@ GCC_METHOD5 (gcc_type, new_template_typename_parm,
    template parameter.  FILENAME and LINE_NUMBER may specify the
    source location in which the template parameter was declared.  */
 
-GCC_METHOD5 (gcc_utempl, new_template_template_parm,
+GCC_METHOD5 (gcc_utempl, build_template_template_parameter,
             const char *,                            /* Argument ID.  */
             int /* bool */,                      /* Argument PACK_P.  */
             gcc_utempl,                   /* Argument DEFAULT_TEMPL.  */
@@ -510,7 +514,7 @@ GCC_METHOD5 (gcc_utempl, new_template_template_parm,
    X).  FILENAME and LINE_NUMBER may specify the source location in
    which the template parameter was declared.  */
 
-GCC_METHOD5 (gcc_decl, new_template_value_parm,
+GCC_METHOD5 (gcc_decl, build_value_template_parameter,
             gcc_type,                              /* Argument TYPE.  */
             const char *,                            /* Argument ID.  */
             gcc_expr,                     /* Argument DEFAULT_VALUE.  */
@@ -525,13 +529,13 @@ GCC_METHOD5 (gcc_decl, new_template_value_parm,
    (e.g. <X>) iff ID is to name a class template.
 
    In this and other calls, a template-dependent nested name specifier
-   may be a template class parameter (new_template_typename_parm), a
-   specialization (returned by new_dependent_typespec) of a template
-   template parameter (returned by new_template_template_parm) or a
-   member type thereof (returned by new_dependent_typename
-   itself).  */
+   may be a template class parameter (build_type_template_parameter),
+   a specialization (returned by build_dependent_type_template_id) of
+   a template template parameter (returned by
+   build_template_template_parameter) or a member type thereof
+   (returned by build_dependent_typename itself).  */
 
-GCC_METHOD3 (gcc_type, new_dependent_typename,
+GCC_METHOD3 (gcc_type, build_dependent_typename,
             gcc_type,                    /* Argument ENCLOSING_TYPE.  */
             const char *,                            /* Argument ID.  */
             const struct gcc_cp_template_args *)  /* Argument TARGS.  */
@@ -541,21 +545,21 @@ GCC_METHOD3 (gcc_type, new_dependent_typename,
    specifier (e.g., T), ID should be the name of the class template
    member of the ENCLOSING_TYPE (e.g., bart).  */
 
-GCC_METHOD2 (gcc_utempl, new_dependent_class_template,
+GCC_METHOD2 (gcc_utempl, build_dependent_class_template,
             gcc_type,                    /* Argument ENCLOSING_TYPE.  */
             const char *)                            /* Argument ID.  */
 
-/* Build a template-dependent template type specialization (e.g.,
-   T<A>).  TEMPLATE_DECL should be a template template parameter
-   (e.g., the T in template <template <[...]> class T = X>), and TARGS
-   should specify the template arguments (e.g. <A>).  */
+/* Build a template-dependent template type id (e.g., T<A>).
+   TEMPLATE_DECL should be a template template parameter (e.g., the T
+   in template <template <[...]> class T = X>), and TARGS should
+   specify the template arguments (e.g. <A>).  */
 
-GCC_METHOD2 (gcc_type, new_dependent_typespec,
+GCC_METHOD2 (gcc_type, build_dependent_type_template_id,
             gcc_utempl,                   /* Argument TEMPLATE_DECL.  */
             const struct gcc_cp_template_args *)  /* Argument TARGS.  */
 
-/* Build a template-dependent value expression (e.g., S::val or
-   S::template mtf<X>, or unqualified f or template tf<X>).
+/* Build a template-dependent expression (e.g., S::val or S::template
+   mtf<X>, or unqualified f or template tf<X>).
 
    ENCLOSING_SCOPE should be a template-dependent nested name
    specifier (e.g., T), a resolved namespace or class decl, or NULL
@@ -578,7 +582,7 @@ GCC_METHOD2 (gcc_type, new_dependent_typespec,
    If ID is the name of a special member function, FLAGS should be
    GCC_CP_SYMBOL_FUNCTION|GCC_CP_FLAG_SPECIAL_FUNCTION, and ID should
    be one of the encodings for special member functions documented in
-   new_decl.  Otherwise, FLAGS should be GCC_CP_SYMBOL_MASK, which
+   build_decl.  Otherwise, FLAGS should be GCC_CP_SYMBOL_MASK, which
    suggests the symbol kind is not known (though we know it is not a
    type).
 
@@ -586,7 +590,7 @@ GCC_METHOD2 (gcc_type, new_dependent_typespec,
    target type of the conversion.  Otherwise, CONV_TYPE must be
    NULL.  */
 
-GCC_METHOD5 (gcc_expr, new_dependent_value_expr,
+GCC_METHOD5 (gcc_expr, build_dependent_expr,
             gcc_decl,                   /* Argument ENCLOSING_SCOPE.  */
             enum gcc_cp_symbol_kind,              /* Argument FLAGS.  */
             const char *,                          /* Argument NAME.  */
@@ -595,7 +599,7 @@ GCC_METHOD5 (gcc_expr, new_dependent_value_expr,
 
 /* Build a gcc_expr for the value VALUE in type TYPE.  */
 
-GCC_METHOD2 (gcc_expr, literal_expr,
+GCC_METHOD2 (gcc_expr, build_literal_expr,
             gcc_type,            /* Argument TYPE.  */
             unsigned long)       /* Argument VALUE.  */
 
@@ -604,7 +608,7 @@ GCC_METHOD2 (gcc_expr, literal_expr,
    function.  Use QUALIFIED_P to build the operand of unary & so as to
    compute a pointer-to-member, rather than a regular pointer.  */
 
-GCC_METHOD2 (gcc_expr, decl_expr,
+GCC_METHOD2 (gcc_expr, build_decl_expr,
             gcc_decl,                  /* Argument DECL.  */
             int /* bool */)            /* Argument QUALIFIED_P.  */
 
@@ -618,7 +622,7 @@ GCC_METHOD2 (gcc_expr, decl_expr,
    delete[], "gsda" for ::delete[], "sp" for pack expansion, "sZ" for
    sizeof...(function argument pack).  */
 
-GCC_METHOD2 (gcc_expr, unary_value_expr,
+GCC_METHOD2 (gcc_expr, build_unary_expr,
             const char *,        /* Argument UNARY_OP.  */
             gcc_expr)            /* Argument OPERAND.  */
 
@@ -629,9 +633,9 @@ GCC_METHOD2 (gcc_expr, unary_value_expr,
    operators that take a name as their second operand ("." and "->")
    use decl_expr to convert the gcc_decl of the member name to a
    gcc_expr, if the member name wasn't created with
-   e.g. new_dependent_value_expr.  */
+   e.g. build_dependent_expr.  */
 
-GCC_METHOD3 (gcc_expr, binary_value_expr,
+GCC_METHOD3 (gcc_expr, build_binary_expr,
             const char *,        /* Argument BINARY_OP.  */
             gcc_expr,            /* Argument OPERAND1.  */
             gcc_expr)            /* Argument OPERAND2.  */
@@ -640,7 +644,7 @@ GCC_METHOD3 (gcc_expr, binary_value_expr,
    applied to gcc_exprs OPERAND1, OPERAND2 and OPERAND3.  The only
    supported TERNARY_OP is "qu", for the "?:" operator.  */
 
-GCC_METHOD4 (gcc_expr, ternary_value_expr,
+GCC_METHOD4 (gcc_expr, build_ternary_expr,
             const char *,        /* Argument TERNARY_OP.  */
             gcc_expr,            /* Argument OPERAND1.  */
             gcc_expr,            /* Argument OPERAND2.  */
@@ -651,7 +655,7 @@ GCC_METHOD4 (gcc_expr, ternary_value_expr,
    are "ti" for typeid, "st" for sizeof, "at" for alignof, and "sZ"
    for sizeof...(template argument pack).  */
 
-GCC_METHOD2 (gcc_expr, unary_type_expr,
+GCC_METHOD2 (gcc_expr, build_unary_type_expr,
             const char *,        /* Argument UNARY_OP.  */
             gcc_type)            /* Argument OPERAND.  */
 
@@ -661,7 +665,7 @@ GCC_METHOD2 (gcc_expr, unary_type_expr,
    for dynamic, static, const and reinterpret casts, respectively;
    "cv" for functional or C-style casts).  */
 
-GCC_METHOD3 (gcc_expr, type_value_expr,
+GCC_METHOD3 (gcc_expr, build_cast_expr,
             const char *,        /* Argument BINARY_OP.  */
             gcc_type,            /* Argument OPERAND1.  */
             gcc_expr)            /* Argument OPERAND2.  */
@@ -672,7 +676,7 @@ GCC_METHOD3 (gcc_expr, type_value_expr,
    braced initializer list; pass "il" for CONV_OP, and NULL for
    TYPE).  */
 
-GCC_METHOD3 (gcc_expr, values_expr,
+GCC_METHOD3 (gcc_expr, build_expression_list_expr,
             const char *,                       /* Argument CONV_OP.  */
             gcc_type,                              /* Argument TYPE.  */
             const struct gcc_cp_function_args *) /* Argument VALUES.  */
@@ -685,7 +689,7 @@ GCC_METHOD3 (gcc_expr, values_expr,
    specified initializer, INITIALIZER must be NULL; a zero-length arg
    list stands for a default initializer.  */
 
-GCC_METHOD4 (gcc_expr, alloc_expr,
+GCC_METHOD4 (gcc_expr, build_new_expr,
             const char *,                             /* Argument NEW_OP.  */
             const struct gcc_cp_function_args *,   /* Argument PLACEMENT.  */
             gcc_type,                                   /* Argument TYPE.  */
@@ -693,13 +697,12 @@ GCC_METHOD4 (gcc_expr, alloc_expr,
 
 /* Return a call expression that calls CALLABLE with arguments ARGS.
    CALLABLE may be a function, a callable object, a pointer to
-   function, an unresolved value expression, an unresolved overload
-   set, an object expression combined with a member function overload
-   set or a pointer-to-member.  If QUALIFIED_P, CALLABLE will be
-   interpreted as a qualified name, preventing virtual function
-   dispatch.  */
+   function, an unresolved expression, an unresolved overload set, an
+   object expression combined with a member function overload set or a
+   pointer-to-member.  If QUALIFIED_P, CALLABLE will be interpreted as
+   a qualified name, preventing virtual function dispatch.  */
 
-GCC_METHOD3 (gcc_expr, call_expr,
+GCC_METHOD3 (gcc_expr, build_call_expr,
             gcc_expr,                        /* Argument CALLABLE.  */
             int /* bool */,               /* Argument QUALIFIED_P.  */
             const struct gcc_cp_function_args *) /* Argument ARGS.  */
@@ -712,7 +715,7 @@ GCC_METHOD3 (gcc_expr, call_expr,
    because the type is only computed when template argument
    substitution is performed.  */
 
-GCC_METHOD1 (gcc_type, expr_type,
+GCC_METHOD1 (gcc_type, get_expr_type,
             gcc_expr)            /* Argument OPERAND.  */
 
 /* Introduce a specialization of a template function.
@@ -722,7 +725,7 @@ GCC_METHOD1 (gcc_type, expr_type,
    specialization.  FILENAME and LINE_NUMBER specify the source
    location associated with the template function specialization.  */
 
-GCC_METHOD5 (gcc_decl, specialize_function_template,
+GCC_METHOD5 (gcc_decl, build_function_template_specialization,
             gcc_decl,                     /* Argument TEMPLATE_DECL.  */
             const struct gcc_cp_template_args *,  /* Argument TARGS.  */
             gcc_address,                        /* Argument ADDRESS.  */
@@ -730,14 +733,14 @@ GCC_METHOD5 (gcc_decl, specialize_function_template,
             unsigned int)            /* Argument LINE_NUMBER.  */
 
 /* Specialize a template class as an incomplete type.  A definition
-   can be supplied later, with start_class_definition.
+   can be supplied later, with start_class_type.
 
    TEMPLATE_DECL is the template class, and TARGS are the arguments
    for the specialization.  FILENAME and LINE_NUMBER specify the
    source location associated with the template class
    specialization.  */
 
-GCC_METHOD4 (gcc_decl, specialize_class_template,
+GCC_METHOD4 (gcc_decl, build_class_template_specialization,
             gcc_decl,                     /* Argument TEMPLATE_DECL.  */
             const struct gcc_cp_template_args *,  /* Argument TARGS.  */
             const char *,            /* Argument FILENAME.  */
@@ -747,12 +750,12 @@ GCC_METHOD4 (gcc_decl, specialize_class_template,
    own binding level.  Initially it has no fields.
 
    TYPEDECL is the forward-declaration of the type, returned by
-   new_decl.  BASE_CLASSES indicate the base classes of class NAME.
+   build_decl.  BASE_CLASSES indicate the base classes of class NAME.
    FILENAME and LINE_NUMBER specify the source location associated
    with the class definition, should they be different from those of
    the forward declaration.  */
 
-GCC_METHOD4 (gcc_type, start_class_definition,
+GCC_METHOD4 (gcc_type, start_class_type,
             gcc_decl,                /* Argument TYPEDECL.  */
             const struct gcc_vbase_array *,/* Argument BASE_CLASSES.  */
             const char *,            /* Argument FILENAME.  */
@@ -762,16 +765,15 @@ GCC_METHOD4 (gcc_type, start_class_definition,
    DISCRIMINATOR-numbered closure type in the current scope (or
    associated with EXTRA_SCOPE, if non-NULL), and enter the closure
    type's own binding level.  This primitive would sort of combine
-   new_decl and start_class_definition, if they could be used to
-   introduce a closure type.  Initially it has no fields.
+   build_decl and start_class_type, if they could be used to introduce
+   a closure type.  Initially it has no fields.
 
-   NAME is the class name.  FILENAME and LINE_NUMBER specify the
-   source location associated with the class.  EXTRA_SCOPE, if
-   non-NULL, must be a PARM_DECL of the current function, or a
-   FIELD_DECL of the current class.  If it is NULL, the current scope
-   needs not be a function.  */
+   FILENAME and LINE_NUMBER specify the source location associated
+   with the class.  EXTRA_SCOPE, if non-NULL, must be a PARM_DECL of
+   the current function, or a FIELD_DECL of the current class.  If it
+   is NULL, the current scope must be a function.  */
 
-GCC_METHOD5 (gcc_type, start_new_closure_type,
+GCC_METHOD5 (gcc_type, start_closure_class_type,
             int,                     /* Argument DISCRIMINATOR.  */
             gcc_decl,                /* Argument EXTRA_SCOPE.  */
             enum gcc_cp_symbol_kind, /* Argument FLAGS.  */
@@ -783,7 +785,7 @@ GCC_METHOD5 (gcc_type, start_new_closure_type,
    FIELD_TYPE is the type of the field.  BITSIZE and BITPOS indicate
    where in the struct the field occurs.  */
 
-GCC_METHOD5 (gcc_decl, new_field,
+GCC_METHOD5 (gcc_decl, build_field,
             const char *,                 /* Argument FIELD_NAME.  */
             gcc_type,                     /* Argument FIELD_TYPE.  */
             enum gcc_cp_symbol_kind,      /* Argument FIELD_FLAGS.  */
@@ -793,9 +795,10 @@ GCC_METHOD5 (gcc_decl, new_field,
 /* After all the fields have been added to a struct, class or union,
    the struct or union type must be "finished".  This does some final
    cleanups in GCC, and pops to the binding level that was in effect
-   before the matching build_class_type or build_union_type.  */
+   before the matching start_class_type or
+   start_closure_class_type.  */
 
-GCC_METHOD1 (int /* bool */, finish_record_or_union,
+GCC_METHOD1 (int /* bool */, finish_class_type,
             unsigned long)                /* Argument SIZE_IN_BYTES.  */
 
 /* Create a new 'enum' type, and record it in the current binding
@@ -804,7 +807,7 @@ GCC_METHOD1 (int /* bool */, finish_record_or_union,
    NAME is the enum name.  FILENAME and LINE_NUMBER specify its source
    location.  */
 
-GCC_METHOD5 (gcc_type, start_new_enum_type,
+GCC_METHOD5 (gcc_type, start_enum_type,
             const char *,            /* Argument NAME.  */
             gcc_type,                /* Argument UNDERLYING_INT_TYPE. */
             enum gcc_cp_symbol_kind, /* Argument FLAGS.  */
@@ -814,7 +817,7 @@ GCC_METHOD5 (gcc_type, start_new_enum_type,
 /* Add a new constant to an enum type.  NAME is the constant's name
    and VALUE is its value.  Returns a gcc_decl for the constant.  */
 
-GCC_METHOD3 (gcc_decl, build_add_enum_constant,
+GCC_METHOD3 (gcc_decl, build_enum_constant,
             gcc_type,                 /* Argument ENUM_TYPE.  */
             const char *,             /* Argument NAME.  */
             unsigned long)            /* Argument VALUE.  */
@@ -835,24 +838,6 @@ GCC_METHOD3 (gcc_type, build_function_type,
             const struct gcc_type_array *,/* Argument ARGUMENT_TYPES.  */
             int /* bool */)               /* Argument IS_VARARGS.  */
 
-/* Create a modified version of a function type that has default
-   values for some of its arguments.  The returned type should ONLY be
-   used to define functions or methods, never to declare parameters,
-   variables, types or the like.
-
-   DEFAULTS must have at most as many N_ELEMENTS as there are
-   arguments without default values in FUNCTION_TYPE.  Say, if
-   FUNCTION_TYPE has an argument list such as (T1, T2, T3, T4 = V0)
-   and DEFAULTS has 2 elements (V1, V2), the returned type will have
-   the following argument list: (T1, T2 = V1, T3 = V2, T4 = V0).
-
-   Any NULL expressions in DEFAULTS will be marked as deferred, and
-   they should be filled in with set_deferred_function_default_args.  */
-
-GCC_METHOD2 (gcc_type, add_function_default_args,
-            gcc_type,                       /* Argument FUNCTION_TYPE.  */
-            const struct gcc_cp_function_args *) /* Argument DEFAULTS.  */
-
 /* Create a variant of a function type with an exception
    specification.  FUNCTION_TYPE is a function or method type.
    EXCEPT_TYPES is an array with the list of exception types.  Zero as
@@ -879,16 +864,6 @@ GCC_METHOD4 (gcc_type, build_method_type,
             enum gcc_cp_qualifiers,       /* Argument QUALS.  */
             enum gcc_cp_ref_qualifiers)   /* Argument RQUALS.  */
 
-/* Fill in the first deferred default args in FUNCTION_DECL with the
-   expressions given in DEFAULTS.  This can be used when the
-   declaration of a parameter is needed to create a default
-   expression, such as taking the size of an earlier parameter, or
-   building a lambda expression in the parameter's context.  */
-
-GCC_METHOD2 (int /* bool */, set_deferred_function_default_args,
-            gcc_decl,                       /* Argument FUNCTION_DECL.  */
-            const struct gcc_cp_function_args *) /* Argument DEFAULTS.  */
-
 /* Return a declaration for the (INDEX - 1)th argument of
    FUNCTION_DECL, i.e., for the first argument, use zero as the index.
    If FUNCTION_DECL is a non-static member function, use -1 to get the
@@ -904,14 +879,14 @@ GCC_METHOD2 (gcc_decl, get_function_parameter_decl,
    expressions in default parameters, the only kind that may have to
    be introduced through this interface.  */
 
-GCC_METHOD1 (gcc_expr, get_lambda_expr,
+GCC_METHOD1 (gcc_expr, build_lambda_expr,
             gcc_type)                        /* Argument CLOSURE_TYPE.  */
 
 /* Return an integer type with the given properties.  If BUILTIN_NAME
    is non-NULL, it must name a builtin integral type with the given
    signedness and size, and that is the type that will be returned.  */
 
-GCC_METHOD3 (gcc_type, int_type,
+GCC_METHOD3 (gcc_type, get_int_type,
             int /* bool */,               /* Argument IS_UNSIGNED.  */
             unsigned long,                /* Argument SIZE_IN_BYTES.  */
             const char *)                 /* Argument BUILTIN_NAME.  */
@@ -919,23 +894,23 @@ GCC_METHOD3 (gcc_type, int_type,
 /* Return the 'char' type, a distinct type from both 'signed char' and
    'unsigned char' returned by int_type.  */
 
-GCC_METHOD0 (gcc_type, char_type)
+GCC_METHOD0 (gcc_type, get_char_type)
 
 /* Return a floating point type with the given properties.  If BUILTIN_NAME
    is non-NULL, it must name a builtin integral type with the given
    signedness and size, and that is the type that will be returned.  */
 
-GCC_METHOD2 (gcc_type, float_type,
+GCC_METHOD2 (gcc_type, get_float_type,
             unsigned long,                /* Argument SIZE_IN_BYTES.  */
             const char *)                 /* Argument BUILTIN_NAME.  */
 
 /* Return the 'void' type.  */
 
-GCC_METHOD0 (gcc_type, void_type)
+GCC_METHOD0 (gcc_type, get_void_type)
 
 /* Return the 'bool' type.  */
 
-GCC_METHOD0 (gcc_type, bool_type)
+GCC_METHOD0 (gcc_type, get_bool_type)
 
 /* Return the std::nullptr_t type.  */
 
@@ -1007,8 +982,65 @@ GCC_METHOD1 (gcc_type, error,
 /* Declare a static_assert with the given CONDITION and ERRORMSG at
    FILENAME:LINE_NUMBER.  */
 
-GCC_METHOD4 (int /* bool */, new_static_assert,
+GCC_METHOD4 (int /* bool */, add_static_assert,
             gcc_expr,     /* Argument CONDITION.  */
             const char *, /* Argument ERRORMSG.  */
             const char *, /* Argument FILENAME.  */
             unsigned int) /* Argument LINE_NUMBER.  */
+
+#if 0
+
+/* FIXME: We don't want to expose the internal implementation detail
+   that default parms are stored in function types, and it's not clear
+   how this or other approaches would interact with the type sharing
+   of e.g. ctor clones, so we're leaving this out, since default args
+   are not even present in debug information anyway.  Besides, the set
+   of default args for a function may grow within its scope, and vary
+   independently in other scopes.  */
+
+/* Create a modified version of a function type that has default
+   values for some of its arguments.  The returned type should ONLY be
+   used to define functions or methods, never to declare parameters,
+   variables, types or the like.
+
+   DEFAULTS must have at most as many N_ELEMENTS as there are
+   arguments without default values in FUNCTION_TYPE.  Say, if
+   FUNCTION_TYPE has an argument list such as (T1, T2, T3, T4 = V0)
+   and DEFAULTS has 2 elements (V1, V2), the returned type will have
+   the following argument list: (T1, T2 = V1, T3 = V2, T4 = V0).
+
+   Any NULL expressions in DEFAULTS will be marked as deferred, and
+   they should be filled in with set_deferred_function_default_args.  */
+
+GCC_METHOD2 (gcc_type, add_function_default_args,
+            gcc_type,                       /* Argument FUNCTION_TYPE.  */
+            const struct gcc_cp_function_args *) /* Argument DEFAULTS.  */
+
+/* Fill in the first deferred default args in FUNCTION_DECL with the
+   expressions given in DEFAULTS.  This can be used when the
+   declaration of a parameter is needed to create a default
+   expression, such as taking the size of an earlier parameter, or
+   building a lambda expression in the parameter's context.  */
+
+GCC_METHOD2 (int /* bool */, set_deferred_function_default_args,
+            gcc_decl,                       /* Argument FUNCTION_DECL.  */
+            const struct gcc_cp_function_args *) /* Argument DEFAULTS.  */
+
+#endif
+
+
+/* When you add entry points, add them at the end, so that the new API
+   version remains compatible with the old version.
+
+   The following conventions have been observed as to naming entry points:
+
+   - build_* creates (and maybe records) something and returns it;
+   - add_* creates and records something, but doesn't return it;
+   - get_* obtains something without creating it;
+   - start_* marks the beginning of a compound (type, list, ...);
+   - finish_* completes the compound when needed.
+
+  Entry points that return an int (bool) and don't have a return value
+  specification return nonzero (true) on success and zero (false) on
+  failure.  This is in line with libcc1's conventions of returning a
+  zero-initialized value in case of e.g. a transport error.  */
index 9cae24856ce265f1355c2a946d0d9b547ffd8c17..83cb2d07189e3d49cbae13db253bec26268e609c 100644 (file)
@@ -1,6 +1,6 @@
 /* Interface between GCC C++ FE and GDB
 
-   Copyright (C) 2014-2016 Free Software Foundation, Inc.
+   Copyright (C) 2014-2017 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -41,7 +41,7 @@ struct gcc_cp_context;
 
 enum gcc_cp_api_version
 {
-  GCC_CP_FE_VERSION_0 = 0xffffffff-16
+  GCC_CP_FE_VERSION_0 = 0xffffffff-17
 };
 
 /* Qualifiers.  */
@@ -73,8 +73,6 @@ typedef unsigned long long gcc_utempl;
 
 typedef unsigned long long gcc_expr;
 
-/* FIXME: do we need to support argument packs?  */
-
 typedef enum
   { GCC_CP_TPARG_VALUE, GCC_CP_TPARG_CLASS,
     GCC_CP_TPARG_TEMPL, GCC_CP_TPARG_PACK }
@@ -134,14 +132,14 @@ enum gcc_cp_symbol_kind
 
   GCC_CP_SYMBOL_LABEL,
 
-  /* A class, forward declared in new_decl (to be later defined in
+  /* A class, forward declared in build_decl (to be later defined in
      start_class_definition), or, in a template parameter list scope,
      a declaration of a template class, closing the parameter
      list.  */
 
   GCC_CP_SYMBOL_CLASS,
 
-  /* A union, forward declared in new_decl (to be later defined in
+  /* A union, forward declared in build_decl (to be later defined in
      start_class_definition).  */
 
   GCC_CP_SYMBOL_UNION,
@@ -197,12 +195,10 @@ enum gcc_cp_symbol_kind
      operators.  */
   GCC_CP_FLAG_SPECIAL_FUNCTION = GCC_CP_FLAG_BASE,
 
-  /* We intentionally cannot express inline, constexpr, friend or
-     virtual override for functions.  We can't inline or
-     constexpr-replace without a source-level body.  Since we disable
-     access control, friend is meaningless.  The override keyword is
-     only meaningless within the definition of the containing
-     class.  */
+  /* We intentionally cannot express inline, constexpr, or virtual
+     override for functions.  We can't inline or constexpr-replace
+     without a source-level body.  The override keyword is only
+     meaningful within the definition of the containing class.  */
 
   /* This indicates a "virtual" member function, explicitly or
      implicitly (due to a virtual function with the same name and
@@ -296,8 +292,8 @@ enum gcc_cp_symbol_kind
                               - GCC_CP_FLAG_BASE),
 
 
-  /* Flags to be used when introducing a class with
-     start_new_class_type, or a class template with new_decl.  */
+  /* Flags to be used when introducing a class or a class template
+     with build_decl.  */
 
   /* This indicates an enum type without any flags.  */
   GCC_CP_FLAG_CLASS_NOFLAG = 0,
@@ -364,20 +360,12 @@ struct gcc_vbase_array
 
 enum gcc_cp_oracle_request
 {
-  /* An ordinary symbol -- a variable, function, typedef, or enum
-     constant.  All namespace-scoped symbols with the requested name
-     should be defined in response to this request.  */
-
-  GCC_CP_ORACLE_SYMBOL,
-
-  /* A struct, union, or enum tag.  All members of the tagged type
-     should be defined in response to this request.  */
-
-  GCC_CP_ORACLE_TAG,
-
-  /* A label.  */
+  /* An identifier in namespace scope -- type, variable, function,
+     namespace, template.  All namespace-scoped symbols with the
+     requested name, in any namespace (including the global
+     namespace), should be defined in response to this request.  */
 
-  GCC_CP_ORACLE_LABEL
+  GCC_CP_ORACLE_IDENTIFIER
 };
 
 /* The type of the function called by GCC to ask GDB for a symbol's