parent
0d78176b02
commit
e92cc02916
254
gcc/cp/ChangeLog
254
gcc/cp/ChangeLog
|
@ -1,3 +1,228 @@
|
|||
Tue Jul 9 17:48:48 1996 Mike Stump <mrs@cygnus.com>
|
||||
|
||||
* decl.c (lookup_name_real): If we find mem in obj when parsing
|
||||
`obj->mem', make sure we return the right value.
|
||||
|
||||
Tue Jul 9 16:11:28 1996 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* search.c (get_base_distance): Call complete_type.
|
||||
|
||||
Tue Jul 9 12:46:34 1996 Mike Stump <mrs@cygnus.com>
|
||||
|
||||
* decl.c (store_bindings): Make static.
|
||||
|
||||
Mon Jul 8 16:42:31 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* init.c (expand_aggr_init_1): Don't check type conversions if
|
||||
NEW_OVER.
|
||||
|
||||
* cvt.c (z_candidate): Put back template field.
|
||||
(add_function_candidate): Set it.
|
||||
(add_template_candidate): Likewise.
|
||||
(joust): Use it.
|
||||
(compare_qual): Handle references and pointers to members.
|
||||
(compare_ics): Handle reference bindings.
|
||||
|
||||
* decl.c (duplicate_decls): Propagate DECL_ONE_ONLY.
|
||||
|
||||
Mon Jul 8 16:18:56 1996 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* call.c (compute_conversion_costs): Call complete_type.
|
||||
|
||||
* tree.c (vec_binfo_member): Use comptypes instead of comparing
|
||||
pointers, so we can handle template parameters.
|
||||
|
||||
Fri Jul 5 16:51:53 1996 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* cvt.c (cp_convert_to_pointer): We have to call complete_type
|
||||
here; let's make it explicit instead of a side effect of an
|
||||
error check.
|
||||
|
||||
Wed Jul 3 16:29:51 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* cvt.c (z_candidate): Remove template field.
|
||||
(reference_binding): Handle binding to temporary.
|
||||
(implicit_conversion): Likewise.
|
||||
(add_function_candidate): Handle artificial constructor parms.
|
||||
Handle functions with too few parms.
|
||||
(add_template_candidate): New function.
|
||||
(build_user_type_conversion_1): Handle constructors.
|
||||
(convert_like): Likewise.
|
||||
(build_over_call): Likewise.
|
||||
(build_new_function_call): Support templates.
|
||||
(compare_ics): Fix reference, inheritance handling.
|
||||
|
||||
Mon Jul 1 22:58:18 1996 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* decl.c: Add signed_size_zero_node.
|
||||
(init_decl_processing): Build it.
|
||||
* class.c (prepare_fresh_vtable): Use it instead of size_zero_node
|
||||
when we're trying to make a negative delta.
|
||||
|
||||
Mon Jul 1 17:56:19 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
|
||||
|
||||
Stop doing this damn index==strchr variable name confusion.
|
||||
* class.c (add_virtual_function): Change local var INDEX to be
|
||||
named IDX.
|
||||
(add_method): Likewise.
|
||||
* lex.c (print_parse_statistics): Likewise.
|
||||
* search.c (make_memoized_table_entry): Likewise.
|
||||
(lookup_fnfields_here): Likewise.
|
||||
(lookup_field): Likewise.
|
||||
(lookup_fnfields): Likewise.
|
||||
(get_baselinks): Likewise.
|
||||
* sig.c (build_signature_table_constructor): Likewise.
|
||||
(build_signature_method_call): Likewise.
|
||||
* typeck.c (build_x_array_ref): Change INDEX parm to be named IDX.
|
||||
(get_member_function_from_ptrfunc): Likewise.
|
||||
(build_ptrmemfunc): Change local var INDEX to be IDX.
|
||||
(c_expand_start_case): Likewise.
|
||||
|
||||
Sat Jun 29 14:05:46 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* cvt.c (cp_convert_to_pointer): Move user-defined type conversion
|
||||
handling to before extraction of TYPE_PTRMEMFUNC_FN_TYPE.
|
||||
(convert_to_reference): Use build_type_conversion to convert to
|
||||
the reference type directly.
|
||||
(standard_conversion): Fix void* case, non-conversions.
|
||||
(reference_binding): Fix expr == 0 case, non-conversions.
|
||||
(convert_like): Support REF_BIND.
|
||||
(compare_qual): Split out from compare_ics.
|
||||
(compare_ics): Use it, handle icses with only a qual_conv.
|
||||
|
||||
* init.c (expand_vec_init): Don't crash if decl is NULL.
|
||||
|
||||
Fri Jun 28 11:52:51 1996 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* mpw-config.in: New file, configury for Mac MPW.
|
||||
* mpw-make.sed: New file, makefile editing for MPW.
|
||||
|
||||
Thu Jun 27 15:18:30 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* pt.c (instantiate_class_template): Call repo_template_used.
|
||||
|
||||
* search.c (lookup_conversions): Only lookup conversions in
|
||||
complete types.
|
||||
|
||||
Thu Jun 27 12:59:53 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
|
||||
|
||||
* cp-tree.def: Renamed from tree.def, to avoid confusion with
|
||||
gcc's tree.def.
|
||||
* cp-tree.h, lex.c: Include cp-tree.def.
|
||||
* Makefile.in (CXX_TREE_H): Reference cp-tree.def.
|
||||
|
||||
Wed Jun 26 18:29:47 1996 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* init.c (build_vec_delete_1): Call complete_type.
|
||||
|
||||
Mon Jun 24 17:17:32 1996 Mike Stump <mrs@cygnus.com>
|
||||
|
||||
* except.c (start_anon_func): Make sure anonymous functions are
|
||||
never external.
|
||||
|
||||
Fri Jun 21 15:10:58 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* decl.c (finish_function): If function_depth > 1, set nested.
|
||||
|
||||
* decl2.c (grokbitfield): Revert Bob's change.
|
||||
* class.c (finish_struct_1): Fix handling of named bitfield widths.
|
||||
|
||||
Thu Jun 20 23:35:38 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* pt.c (add_pending_template): Handle types.
|
||||
(lookup_template_class): With -fexternal-templates, just add the class
|
||||
to pending_templates instead of instantiating it now.
|
||||
* decl2.c (finish_file): Handle types in pending_templates.
|
||||
|
||||
Thu Jun 20 14:08:40 1996 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* decl2.c (grokbitfield): Handle constant decls appropriately.
|
||||
Give an appropriate error message now instead of spewing core
|
||||
later.
|
||||
|
||||
Thu Jun 20 13:01:51 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* decl2.c: Don't turn on thunks by default for now.
|
||||
|
||||
Wed Jun 19 11:37:04 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* typeck.c (complete_type): Handle error_mark_node.
|
||||
(common_type, OFFSET_TYPE): Handle template_type_parms.
|
||||
|
||||
Tue Jun 18 10:02:15 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* pt.c (instantiate_decl): If at_eof, call import_export_decl
|
||||
regardless of DECL_INLINE.
|
||||
|
||||
* typeck.c (mark_addressable): Set TREE_ADDRESSABLE on CONSTRUCTORs.
|
||||
|
||||
* class.c (finish_struct_bits): Copy TYPE_SIZE.
|
||||
|
||||
* rtti.c (build_dynamic_cast): Support templates.
|
||||
* tree.def: Support DYNAMIC_CAST_EXPR.
|
||||
* pt.c (tsubst_copy): Likewise.
|
||||
* decl2.c (build_expr_from_tree): Likewise.
|
||||
|
||||
Mon Jun 17 15:23:36 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* typeck.c (build_static_cast): Support templates.
|
||||
(build_const_cast): Likewise.
|
||||
* tree.def: Support CONST/STATIC_CAST_EXPR.
|
||||
* pt.c (tsubst_copy): Likewise.
|
||||
* decl2.c (build_expr_from_tree): Likewise.
|
||||
|
||||
Sun Jun 16 12:33:57 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* decl2.c (finish_vtable_vardecl): Don't trust
|
||||
TREE_SYMBOL_REFERENCED for vtables of local classes.
|
||||
|
||||
Fri Jun 14 18:13:36 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* pt.c (tsubst_copy): Handle operator T.
|
||||
|
||||
Wed Jun 12 17:52:40 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
|
||||
|
||||
* init.c (build_delete): Move creation of PARMS inside test of
|
||||
TYPE_HAS_DESTRUCTOR, since it's never used outside of that block.
|
||||
|
||||
Tue Jun 11 15:09:18 1996 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* typeck.c (build_conditional_expr): Don't assume that
|
||||
the arguments to ?: are always pointers or records.
|
||||
|
||||
Tue Jun 11 13:56:23 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* decl2.c (import_export_decl): Still emit static/weak/comdat
|
||||
copies of inline template functions with -fno-implicit-templates.
|
||||
|
||||
Tue Jun 11 11:42:13 1996 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* init.c (build_delete): Determine the complete basetype
|
||||
path to the destructor we're calling.
|
||||
|
||||
Fri Jun 7 15:30:10 1996 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* decl.c (build_enumerator): Always copy the INTEGER_CST used to
|
||||
initialize the enum, because we really and truly don't know where
|
||||
it came from.
|
||||
(start_enum): Don't copy integer_zero_node because
|
||||
build_enumerator will do it.
|
||||
|
||||
Fri Jun 7 11:11:09 1996 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* decl.c (finish_function): Do access control on base destructors.
|
||||
|
||||
* pt.c (tsubst, case FUNCTION_DECL): Set up
|
||||
IDENTIFIER_GLOBAL_VALUE for member functions so pushdecl doesn't
|
||||
hose us.
|
||||
|
||||
Fri Jun 7 10:37:33 1996 Mike Stump <mrs@cygnus.com>
|
||||
|
||||
* cvt.c (build_up_reference): If we have already extended the
|
||||
lifetime of the temporary, don't try it again.
|
||||
* typeck.c (c_expand_return): Don't try and convert the return
|
||||
value twice when we want a reference, once is enough.
|
||||
|
||||
Sat May 11 04:33:50 1996 Doug Evans <dje@canuck.cygnus.com>
|
||||
|
||||
* decl2.c (finish_vtable_vardecl): Surround DECL_ONE_ONLY with ifdef.
|
||||
|
@ -2215,8 +2440,6 @@ Mon Jan 15 08:45:01 1996 Jeffrey A Law (law@cygnus.com)
|
|||
|
||||
* tree.c (layout_basetypes): Call build_lang_field_decl instead
|
||||
of build_lang_decl if first arg is a FIELD_DECL.
|
||||
(tree_copy_lang_decl_for_deferred_output): Reverse test for when
|
||||
to copy DECL_MAIN_VARIANT and DECL_CHAIN.
|
||||
|
||||
Thu Jan 11 14:55:07 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
|
||||
|
||||
|
@ -2335,11 +2558,6 @@ Sun Dec 17 21:13:23 1995 Rusty Russell <rusty@adelaide.maptek.com.au>
|
|||
|
||||
* init.c (expand_member_init): warning for base init after members.
|
||||
|
||||
Sun Dec 17 22:06:56 1995 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* tree.c (tree_copy_lang_decl_for_deferred_output): Handle
|
||||
CONST_DECLs correctly.
|
||||
|
||||
Fri Dec 15 15:32:18 1995 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* cvt.c (build_expr_type_conversion): Don't convert to a reference
|
||||
|
@ -2531,14 +2749,6 @@ Mon Nov 13 15:45:34 1995 Mike Stump <mrs@cygnus.com>
|
|||
(emit_base_init): Ditto.
|
||||
(expand_aggr_vbase_init_1): Ditto.
|
||||
|
||||
Fri Nov 10 09:19:31 1995 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* tree.c (tree_copy_lang_decl_for_deferred_output): Handle
|
||||
copying of DECL_ARGUMENTS field.
|
||||
(tree_copy_lang_type_for_deferred_output): Handle disgusting
|
||||
re-use of TYPE_LANG_SPECIFIC for pointer to member function
|
||||
type nodes.
|
||||
|
||||
Fri Nov 10 09:18:09 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
|
||||
|
||||
* decl.c (push_namespace): Rewrite to use build_lang_decl, so we
|
||||
|
@ -2595,11 +2805,6 @@ Tue Oct 31 11:56:55 1995 Jason Merrill <jason@yorick.cygnus.com>
|
|||
|
||||
* decl2.c (grokclassfn): Tweak __in_chrg attributes.
|
||||
|
||||
Thu Oct 26 20:58:59 1995 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* cp/tree.c (tree_copy_lang_decl_for_deferred_output): Handle
|
||||
FIELD_DECLs and VAR_DECLs correctly.
|
||||
|
||||
Thu Oct 26 16:45:58 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
|
||||
|
||||
* errfn.c: Include stdio.h.
|
||||
|
@ -2726,15 +2931,6 @@ Fri Oct 6 14:44:27 1995 Mike Stump <mrs@cygnus.com>
|
|||
* typeck.c (mark_addressable): Add missing call to
|
||||
assemble_external.
|
||||
|
||||
Wed Oct 4 22:05:23 1995 Jeff Law (law@hurl.cygnus.com
|
||||
|
||||
* cp/decl.c (deplicate_decls): Merge in deferred output
|
||||
status for variables.
|
||||
* cp/tree.c (tree_copy_lang_decl_for_deferred_output): New
|
||||
function to copy the g++ specific parts of a DECL node.
|
||||
(tree_copy_lang_type_for_deferred_output): Similarly for
|
||||
TYPE nodes.
|
||||
|
||||
Wed Oct 4 15:06:39 1995 Mike Stump <mrs@cygnus.com>
|
||||
|
||||
* decl.c (store_parm_decls): Make sure the unwinder start comes
|
||||
|
|
|
@ -187,7 +187,7 @@ RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
|
|||
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
|
||||
TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
|
||||
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
|
||||
CXX_TREE_H = $(TREE_H) cp-tree.h tree.def
|
||||
CXX_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
|
||||
PARSE_H = $(srcdir)/parse.h
|
||||
PARSE_C = $(srcdir)/parse.c
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ extern tree ctor_label, dtor_label;
|
|||
|
||||
/* Compute the ease with which a conversion can be performed
|
||||
between an expected and the given type. */
|
||||
|
||||
static struct harshness_code convert_harshness PROTO((register tree, register tree, tree));
|
||||
|
||||
#define EVIL_RETURN(ARG) ((ARG).code = EVIL_CODE, (ARG))
|
||||
|
@ -52,6 +53,7 @@ static struct harshness_code convert_harshness PROTO((register tree, register tr
|
|||
|
||||
/* Ordering function for overload resolution. Compare two candidates
|
||||
by gross quality. */
|
||||
|
||||
int
|
||||
rank_for_overload (x, y)
|
||||
struct candidate *x, *y;
|
||||
|
@ -79,6 +81,7 @@ rank_for_overload (x, y)
|
|||
}
|
||||
|
||||
/* Compare two candidates, argument by argument. */
|
||||
|
||||
int
|
||||
rank_for_ideal (x, y)
|
||||
struct candidate *x, *y;
|
||||
|
@ -108,6 +111,7 @@ rank_for_ideal (x, y)
|
|||
/* TYPE is the type we wish to convert to. PARM is the parameter
|
||||
we have to work with. We use a somewhat arbitrary cost function
|
||||
to measure this conversion. */
|
||||
|
||||
static struct harshness_code
|
||||
convert_harshness (type, parmtype, parm)
|
||||
register tree type, parmtype;
|
||||
|
@ -947,8 +951,8 @@ compute_conversion_costs (function, tta_in, cp, arglen)
|
|||
if (formal_type != error_mark_node
|
||||
&& actual_type != error_mark_node)
|
||||
{
|
||||
formal_type = TYPE_MAIN_VARIANT (formal_type);
|
||||
actual_type = TYPE_MAIN_VARIANT (actual_type);
|
||||
formal_type = complete_type (TYPE_MAIN_VARIANT (formal_type));
|
||||
actual_type = complete_type (TYPE_MAIN_VARIANT (actual_type));
|
||||
|
||||
if (TYPE_HAS_CONSTRUCTOR (formal_type))
|
||||
{
|
||||
|
@ -1041,6 +1045,7 @@ compute_conversion_costs (function, tta_in, cp, arglen)
|
|||
|
||||
/* Subroutine of ideal_candidate. See if X or Y is a better match
|
||||
than the other. */
|
||||
|
||||
static int
|
||||
strictly_better (x, y)
|
||||
unsigned short x, y;
|
||||
|
@ -1135,6 +1140,7 @@ ideal_candidate (candidates, n_candidates, len)
|
|||
/* Assume that if the class referred to is not in the
|
||||
current class hierarchy, that it may be remote.
|
||||
PARENT is assumed to be of aggregate type here. */
|
||||
|
||||
static int
|
||||
may_be_remote (parent)
|
||||
tree parent;
|
||||
|
@ -1180,6 +1186,7 @@ build_vfield_ref (datum, type)
|
|||
|
||||
/* Build a call to a member of an object. I.e., one that overloads
|
||||
operator ()(), or is a pointer-to-function or pointer-to-method. */
|
||||
|
||||
static tree
|
||||
build_field_call (basetype_path, instance_ptr, name, parms)
|
||||
tree basetype_path, instance_ptr, name, parms;
|
||||
|
@ -1314,6 +1321,7 @@ find_scoped_type (type, inner_name, inner_types)
|
|||
is a chain of nested type names (held together by SCOPE_REFs);
|
||||
OUTER_TYPE is the type we know to enclose INNER_TYPES.
|
||||
Returns NULL_TREE if there is an error. */
|
||||
|
||||
tree
|
||||
resolve_scope_to_name (outer_type, inner_stuff)
|
||||
tree outer_type, inner_stuff;
|
||||
|
@ -1400,6 +1408,7 @@ resolve_scope_to_name (outer_type, inner_stuff)
|
|||
|
||||
/* Build a method call of the form `EXP->SCOPES::NAME (PARMS)'.
|
||||
This is how virtual function calls are avoided. */
|
||||
|
||||
tree
|
||||
build_scoped_method_call (exp, basetype, name, parms)
|
||||
tree exp, basetype, name, parms;
|
||||
|
@ -1523,6 +1532,7 @@ print_n_candidates (candidates, n)
|
|||
|
||||
/* We want the address of a function or method. We avoid creating a
|
||||
pointer-to-member function. */
|
||||
|
||||
tree
|
||||
build_addr_func (function)
|
||||
tree function;
|
||||
|
@ -1558,6 +1568,7 @@ build_addr_func (function)
|
|||
/* Build a CALL_EXPR, we can handle FUNCTION_TYPEs, METHOD_TYPEs, or
|
||||
POINTER_TYPE to those. Note, pointer to member function types
|
||||
(TYPE_PTRMEMFUNC_P) must be handled by our callers. */
|
||||
|
||||
tree
|
||||
build_call (function, result_type, parms)
|
||||
tree function, result_type, parms;
|
||||
|
@ -1647,6 +1658,7 @@ default_parm_conversions (parms, last)
|
|||
Note that NAME may refer to an instance variable name. If
|
||||
`operator()()' is defined for the type of that field, then we return
|
||||
that result. */
|
||||
|
||||
tree
|
||||
build_method_call (instance, name, parms, basetype_path, flags)
|
||||
tree instance, name, parms, basetype_path;
|
||||
|
@ -2881,6 +2893,7 @@ build_overload_call_real (fnname, parms, flags, final_cp, require_complete)
|
|||
}
|
||||
|
||||
/* This requires a complete type on the result of the call. */
|
||||
|
||||
tree
|
||||
build_overload_call (fnname, parms, flags)
|
||||
tree fnname, parms;
|
||||
|
|
|
@ -120,6 +120,7 @@ int n_inner_fields_searched = 0;
|
|||
#endif
|
||||
|
||||
/* Virtual baseclass things. */
|
||||
|
||||
tree
|
||||
build_vbase_pointer (exp, type)
|
||||
tree exp, type;
|
||||
|
@ -133,6 +134,7 @@ build_vbase_pointer (exp, type)
|
|||
|
||||
/* Is the type of the EXPR, the complete type of the object?
|
||||
If we are going to be wrong, we must be conservative, and return 0. */
|
||||
|
||||
int
|
||||
complete_type_p (expr)
|
||||
tree expr;
|
||||
|
@ -184,6 +186,7 @@ complete_type_p (expr)
|
|||
TYPE is the type we want this path to have on exit.
|
||||
|
||||
ALIAS_THIS is non-zero if EXPR in an expression involving `this'. */
|
||||
|
||||
tree
|
||||
build_vbase_path (code, type, expr, path, alias_this)
|
||||
enum tree_code code;
|
||||
|
@ -359,8 +362,8 @@ build_vbase_path (code, type, expr, path, alias_this)
|
|||
/* Virtual function things. */
|
||||
|
||||
/* Virtual functions to be dealt with after laying out our base
|
||||
classes. We do all overrides after we layout virtual base classes.
|
||||
*/
|
||||
classes. We do all overrides after we layout virtual base classes. */
|
||||
|
||||
static tree pending_hard_virtuals;
|
||||
|
||||
/* Build an entry in the virtual function table.
|
||||
|
@ -368,6 +371,7 @@ static tree pending_hard_virtuals;
|
|||
PFN is an ADDR_EXPR containing a pointer to the virtual function.
|
||||
Note that the index (DELTA2) in the virtual function table
|
||||
is always 0. */
|
||||
|
||||
tree
|
||||
build_vtable_entry (delta, pfn)
|
||||
tree delta, pfn;
|
||||
|
@ -426,6 +430,7 @@ build_vtable_entry (delta, pfn)
|
|||
virtual function vtable element corresponding to INDEX. There are
|
||||
many special cases for INSTANCE which we take care of here, mainly
|
||||
to avoid creating extra tree nodes when we don't have to. */
|
||||
|
||||
tree
|
||||
build_vtbl_ref (instance, idx)
|
||||
tree instance, idx;
|
||||
|
@ -491,6 +496,7 @@ build_vtbl_ref (instance, idx)
|
|||
virtual function corresponding to INDEX. There are many special
|
||||
cases for INSTANCE which we take care of here, mainly to avoid
|
||||
creating extra tree nodes when we don't have to. */
|
||||
|
||||
tree
|
||||
build_vfn_ref (ptr_to_instptr, instance, idx)
|
||||
tree *ptr_to_instptr, instance;
|
||||
|
@ -522,6 +528,7 @@ build_vfn_ref (ptr_to_instptr, instance, idx)
|
|||
|
||||
/* Return the name of the virtual function table (as an IDENTIFIER_NODE)
|
||||
for the given TYPE. */
|
||||
|
||||
static tree
|
||||
get_vtable_name (type)
|
||||
tree type;
|
||||
|
@ -545,6 +552,7 @@ get_vtable_name (type)
|
|||
}
|
||||
|
||||
/* Return the offset to the main vtable for a given base BINFO. */
|
||||
|
||||
tree
|
||||
get_vfield_offset (binfo)
|
||||
tree binfo;
|
||||
|
@ -561,6 +569,7 @@ get_vfield_offset (binfo)
|
|||
that far. The shortened search is useful because the this pointer
|
||||
on method calling is expected to point to a DECL_CONTEXT (fndecl)
|
||||
object, and not a baseclass of it. */
|
||||
|
||||
static tree
|
||||
get_derived_offset (binfo, type)
|
||||
tree binfo, type;
|
||||
|
@ -581,6 +590,7 @@ get_derived_offset (binfo, type)
|
|||
}
|
||||
|
||||
/* Update the rtti info for this class. */
|
||||
|
||||
static void
|
||||
set_rtti_entry (virtuals, offset, type)
|
||||
tree virtuals, offset, type;
|
||||
|
@ -612,6 +622,7 @@ set_rtti_entry (virtuals, offset, type)
|
|||
If BINFO is non-NULL, build the vtable starting with the initial
|
||||
approximation that it is the same as the one which is the head of
|
||||
the association list. */
|
||||
|
||||
static tree
|
||||
build_vtable (binfo, type)
|
||||
tree binfo, type;
|
||||
|
@ -691,8 +702,8 @@ build_vtable (binfo, type)
|
|||
|
||||
Make sure to use the DECL_ASSEMBLER_NAME of the TYPE_NAME of the
|
||||
type, as template have DECL_NAMEs like: X<int>, whereas the
|
||||
DECL_ASSEMBLER_NAME is set to be something the assembler can handle.
|
||||
*/
|
||||
DECL_ASSEMBLER_NAME is set to be something the assembler can handle. */
|
||||
|
||||
static tree
|
||||
build_type_pathname (format, parent, type)
|
||||
char *format;
|
||||
|
@ -734,6 +745,8 @@ build_type_pathname (format, parent, type)
|
|||
return id;
|
||||
}
|
||||
|
||||
extern tree signed_size_zero_node;
|
||||
|
||||
/* Give TYPE a new virtual function table which is initialized
|
||||
with a skeleton-copy of its original initialization. The only
|
||||
entry that changes is the `delta' entry, so we can really
|
||||
|
@ -743,6 +756,7 @@ build_type_pathname (format, parent, type)
|
|||
be needed.
|
||||
|
||||
BINFO is the type association which provided TYPE for FOR_TYPE. */
|
||||
|
||||
static void
|
||||
prepare_fresh_vtable (binfo, for_type)
|
||||
tree binfo, for_type;
|
||||
|
@ -787,7 +801,7 @@ prepare_fresh_vtable (binfo, for_type)
|
|||
offset = BINFO_OFFSET (binfo);
|
||||
|
||||
set_rtti_entry (BINFO_VIRTUALS (binfo),
|
||||
size_binop (MINUS_EXPR, size_zero_node, offset),
|
||||
size_binop (MINUS_EXPR, signed_size_zero_node, offset),
|
||||
for_type);
|
||||
|
||||
#ifdef GATHER_STATISTICS
|
||||
|
@ -810,6 +824,7 @@ prepare_fresh_vtable (binfo, for_type)
|
|||
contains BASE_FNDECL. VIRTUALS is the virtual function table's
|
||||
initializer. We can run off the end, when dealing with virtual
|
||||
destructors in MI situations, return NULL_TREE in that case. */
|
||||
|
||||
static tree
|
||||
get_vtable_entry (virtuals, base_fndecl)
|
||||
tree virtuals, base_fndecl;
|
||||
|
@ -860,6 +875,7 @@ modify_vtable_entry (old_entry_in_list, new_entry, fndecl)
|
|||
|
||||
/* Access the virtual function table entry i. VIRTUALS is the virtual
|
||||
function table's initializer. */
|
||||
|
||||
static tree
|
||||
get_vtable_entry_n (virtuals, n)
|
||||
tree virtuals;
|
||||
|
@ -880,6 +896,7 @@ get_vtable_entry_n (virtuals, n)
|
|||
HAS_VIRTUAL keeps track of how many virtuals there are in our main
|
||||
vtable for the type, and we build upon the PENDING_VIRTUALS list
|
||||
and return it. */
|
||||
|
||||
static tree
|
||||
add_virtual_function (pending_virtuals, has_virtual, fndecl, t)
|
||||
tree pending_virtuals;
|
||||
|
@ -922,21 +939,21 @@ add_virtual_function (pending_virtuals, has_virtual, fndecl, t)
|
|||
/* Build a new INT_CST for this DECL_VINDEX. */
|
||||
{
|
||||
static tree index_table[256];
|
||||
tree index;
|
||||
tree idx;
|
||||
/* We skip a slot for the offset/tdesc entry. */
|
||||
int i = ++(*has_virtual);
|
||||
|
||||
if (i >= 256 || index_table[i] == 0)
|
||||
{
|
||||
index = build_int_2 (i, 0);
|
||||
idx = build_int_2 (i, 0);
|
||||
if (i < 256)
|
||||
index_table[i] = index;
|
||||
index_table[i] = idx;
|
||||
}
|
||||
else
|
||||
index = index_table[i];
|
||||
idx = index_table[i];
|
||||
|
||||
/* Now assign virtual dispatch information. */
|
||||
DECL_VINDEX (fndecl) = index;
|
||||
DECL_VINDEX (fndecl) = idx;
|
||||
DECL_CONTEXT (fndecl) = t;
|
||||
}
|
||||
entry = build_vtable_entry (integer_zero_node, vfn);
|
||||
|
@ -963,6 +980,7 @@ extern struct obstack *current_obstack;
|
|||
|
||||
FIELDS is the entry in the METHOD_VEC vector entry of the class type where
|
||||
the method should be added. */
|
||||
|
||||
void
|
||||
add_method (type, fields, method)
|
||||
tree type, *fields, method;
|
||||
|
@ -1027,12 +1045,12 @@ add_method (type, fields, method)
|
|||
METHOD_VEC always has a slot for such entries. */
|
||||
if (TYPE_IDENTIFIER (type) == DECL_NAME (decl))
|
||||
{
|
||||
int index = !!DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (decl));
|
||||
/* TREE_VEC_ELT (method_vec, index) = decl; */
|
||||
if (decl != TREE_VEC_ELT (method_vec, index))
|
||||
int idx = !!DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (decl));
|
||||
/* TREE_VEC_ELT (method_vec, idx) = decl; */
|
||||
if (decl != TREE_VEC_ELT (method_vec, idx))
|
||||
{
|
||||
DECL_CHAIN (decl) = TREE_VEC_ELT (method_vec, index);
|
||||
TREE_VEC_ELT (method_vec, index) = decl;
|
||||
DECL_CHAIN (decl) = TREE_VEC_ELT (method_vec, idx);
|
||||
TREE_VEC_ELT (method_vec, idx) = decl;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1110,6 +1128,7 @@ add_method (type, fields, method)
|
|||
Note that anonymous fields which are not of UNION_TYPE are
|
||||
not duplicates, they are just anonymous fields. This happens
|
||||
when we have unnamed bitfields, for example. */
|
||||
|
||||
static tree
|
||||
delete_duplicate_fields_1 (field, fields)
|
||||
tree field, fields;
|
||||
|
@ -1197,6 +1216,7 @@ delete_duplicate_fields (fields)
|
|||
|
||||
/* Change the access of FDECL to ACCESS in T.
|
||||
Return 1 if change was legit, otherwise return 0. */
|
||||
|
||||
static int
|
||||
alter_access (t, fdecl, access)
|
||||
tree t;
|
||||
|
@ -1686,6 +1706,7 @@ typecode_p (type, code)
|
|||
|
||||
/* Set memoizing fields and bits of T (and its variants) for later use.
|
||||
MAX_HAS_VIRTUAL is the largest size of any T's virtual function tables. */
|
||||
|
||||
static void
|
||||
finish_struct_bits (t, max_has_virtual)
|
||||
tree t;
|
||||
|
@ -1711,6 +1732,7 @@ finish_struct_bits (t, max_has_virtual)
|
|||
TYPE_MIN_VALUE (variants) = TYPE_MIN_VALUE (t);
|
||||
TYPE_MAX_VALUE (variants) = TYPE_MAX_VALUE (t);
|
||||
TYPE_FIELDS (variants) = TYPE_FIELDS (t);
|
||||
TYPE_SIZE (variants) = TYPE_SIZE (t);
|
||||
variants = TYPE_NEXT_VARIANT (variants);
|
||||
}
|
||||
|
||||
|
@ -1784,6 +1806,7 @@ finish_struct_bits (t, max_has_virtual)
|
|||
/* Add FNDECL to the method_vec growing on the class_obstack. Used by
|
||||
finish_struct_methods. Note, FNDECL cannot be a constructor or
|
||||
destructor, those cases are handled by the caller. */
|
||||
|
||||
static void
|
||||
grow_method (fndecl, method_vec_ptr)
|
||||
tree fndecl;
|
||||
|
@ -2046,12 +2069,11 @@ duplicate_tag_error (t)
|
|||
/* All of the component_decl's were TREE_CHAINed together in the parser.
|
||||
finish_struct_methods walks these chains and assembles all methods with
|
||||
the same base name into DECL_CHAINs. Now we don't need the parser chains
|
||||
anymore, so we unravel them.
|
||||
*/
|
||||
/*
|
||||
* This used to be in finish_struct, but it turns out that the
|
||||
* TREE_CHAIN is used by dbxout_type_methods and perhaps some other things...
|
||||
*/
|
||||
anymore, so we unravel them. */
|
||||
|
||||
/* This used to be in finish_struct, but it turns out that the
|
||||
TREE_CHAIN is used by dbxout_type_methods and perhaps some other
|
||||
things... */
|
||||
if (CLASSTYPE_METHOD_VEC (t))
|
||||
{
|
||||
tree method_vec = CLASSTYPE_METHOD_VEC (t);
|
||||
|
@ -2095,6 +2117,7 @@ duplicate_tag_error (t)
|
|||
}
|
||||
|
||||
/* finish up all new vtables. */
|
||||
|
||||
static void
|
||||
finish_vtbls (binfo, do_self, t)
|
||||
tree binfo;
|
||||
|
@ -2139,6 +2162,7 @@ finish_vtbls (binfo, do_self, t)
|
|||
|
||||
/* True if we should override the given BASE_FNDECL with the given
|
||||
FNDECL. */
|
||||
|
||||
static int
|
||||
overrides (fndecl, base_fndecl)
|
||||
tree fndecl, base_fndecl;
|
||||
|
@ -2215,6 +2239,7 @@ get_class_offset_1 (parent, binfo, context, t, fndecl)
|
|||
|
||||
/* Get the offset to the CONTEXT subobject that is related to the
|
||||
given BINFO. */
|
||||
|
||||
static tree
|
||||
get_class_offset (context, t, binfo, fndecl)
|
||||
tree context, t, binfo, fndecl;
|
||||
|
@ -2248,6 +2273,7 @@ get_class_offset (context, t, binfo, fndecl)
|
|||
}
|
||||
|
||||
/* Skip RTTI information at the front of the virtual list. */
|
||||
|
||||
unsigned HOST_WIDE_INT
|
||||
skip_rtti_stuff (virtuals)
|
||||
tree *virtuals;
|
||||
|
@ -2358,6 +2384,7 @@ modify_one_vtable (binfo, t, fndecl, pfn)
|
|||
}
|
||||
|
||||
/* These are the ones that are not through virtual base classes. */
|
||||
|
||||
static void
|
||||
modify_all_direct_vtables (binfo, do_self, t, fndecl, pfn)
|
||||
tree binfo;
|
||||
|
@ -2384,6 +2411,7 @@ modify_all_direct_vtables (binfo, do_self, t, fndecl, pfn)
|
|||
}
|
||||
|
||||
/* Fixup all the delta entries in this one vtable that need updating. */
|
||||
|
||||
static void
|
||||
fixup_vtable_deltas1 (binfo, t)
|
||||
tree binfo, t;
|
||||
|
@ -2458,6 +2486,7 @@ fixup_vtable_deltas1 (binfo, t)
|
|||
This happens when we have non-overridden virtual functions from a
|
||||
virtual base class, that are at a different offset, in the new
|
||||
hierarchy, because the layout of the virtual bases has changed. */
|
||||
|
||||
static void
|
||||
fixup_vtable_deltas (binfo, init_self, t)
|
||||
tree binfo;
|
||||
|
@ -2483,6 +2512,7 @@ fixup_vtable_deltas (binfo, init_self, t)
|
|||
}
|
||||
|
||||
/* These are the ones that are through virtual base classes. */
|
||||
|
||||
static void
|
||||
modify_all_indirect_vtables (binfo, do_self, via_virtual, t, fndecl, pfn)
|
||||
tree binfo;
|
||||
|
@ -2525,6 +2555,7 @@ modify_all_vtables (t, fndecl, vfn)
|
|||
|
||||
/* Here, we already know that they match in every respect.
|
||||
All we have to check is where they had their declarations. */
|
||||
|
||||
static int
|
||||
strictly_overrides (fndecl1, fndecl2)
|
||||
tree fndecl1, fndecl2;
|
||||
|
@ -2549,6 +2580,7 @@ strictly_overrides (fndecl1, fndecl2)
|
|||
then it is ill-formed. (mrs)
|
||||
|
||||
We take special care to reuse a vtable, if we can. */
|
||||
|
||||
static void
|
||||
override_one_vtable (binfo, old, t)
|
||||
tree binfo, old, t;
|
||||
|
@ -2658,6 +2690,7 @@ override_one_vtable (binfo, old, t)
|
|||
/* Merge in overrides for virtual bases.
|
||||
BINFO is the hierarchy we want to modify, and OLD has the potential
|
||||
overrides. */
|
||||
|
||||
static void
|
||||
merge_overrides (binfo, old, do_self, t)
|
||||
tree binfo, old;
|
||||
|
@ -2688,6 +2721,7 @@ merge_overrides (binfo, old, do_self, t)
|
|||
/* Get the base virtual function declarations in T that are either
|
||||
overridden or hidden by FNDECL as a list. We set TREE_PURPOSE with
|
||||
the overrider/hider. */
|
||||
|
||||
tree
|
||||
get_basefndecls (fndecl, t)
|
||||
tree fndecl, t;
|
||||
|
@ -2725,6 +2759,7 @@ get_basefndecls (fndecl, t)
|
|||
/* Mark the functions that have been hidden with their overriders.
|
||||
Since we start out with all functions already marked with a hider,
|
||||
no need to mark functions that are just hidden. */
|
||||
|
||||
void
|
||||
mark_overriders (fndecl, base_fndecls)
|
||||
tree fndecl, base_fndecls;
|
||||
|
@ -2811,6 +2846,7 @@ check_for_override (decl, ctype)
|
|||
|
||||
/* Warn about hidden virtual functions that are not overridden in t.
|
||||
We know that constructors and destructors don't apply. */
|
||||
|
||||
void
|
||||
warn_hidden (t)
|
||||
tree t;
|
||||
|
@ -2881,6 +2917,7 @@ warn_hidden (t)
|
|||
|
||||
/* Check for things that are invalid. There are probably plenty of other
|
||||
things we should check for also. */
|
||||
|
||||
static void
|
||||
finish_struct_anon (t)
|
||||
tree t;
|
||||
|
@ -3413,14 +3450,10 @@ finish_struct_1 (t, attributes, warn_anon)
|
|||
cp_warning_at ("`%D' is too small to hold all values of `%#T'",
|
||||
x, TREE_TYPE (x));
|
||||
}
|
||||
}
|
||||
|
||||
/* Process valid field width. */
|
||||
if (DECL_INITIAL (x))
|
||||
{
|
||||
register int width = TREE_INT_CST_LOW (DECL_INITIAL (x));
|
||||
|
||||
if (width == 0)
|
||||
if (DECL_INITIAL (x) == NULL_TREE)
|
||||
;
|
||||
else if (width == 0)
|
||||
{
|
||||
#ifdef EMPTY_FIELD_BOUNDARY
|
||||
DECL_ALIGN (x) = MAX (DECL_ALIGN (x), EMPTY_FIELD_BOUNDARY);
|
||||
|
@ -4380,6 +4413,7 @@ finish_struct (t, list_of_fieldlists, attributes, warn_anon)
|
|||
|
||||
*NONNULL is set iff INSTANCE can be known to be nonnull, regardless
|
||||
of our knowledge of its type. */
|
||||
|
||||
int
|
||||
resolves_to_fixed_type_p (instance, nonnull)
|
||||
tree instance;
|
||||
|
@ -4636,6 +4670,7 @@ pushclass (type, modify)
|
|||
previously, that is the one popped to. The flag MODIFY tells whether
|
||||
the current scope declarations needs to be modified as a result of
|
||||
popping to the previous scope. 0 is used for class definitions. */
|
||||
|
||||
void
|
||||
popclass (modify)
|
||||
int modify;
|
||||
|
@ -4762,6 +4797,7 @@ push_lang_context (name)
|
|||
}
|
||||
|
||||
/* Get out of the current language scope. */
|
||||
|
||||
void
|
||||
pop_lang_context ()
|
||||
{
|
||||
|
@ -4789,6 +4825,7 @@ root_lang_context_p ()
|
|||
|
||||
This function is used in build_modify_expr, convert_arguments,
|
||||
build_c_cast, and compute_conversion_costs. */
|
||||
|
||||
tree
|
||||
instantiate_type (lhstype, rhs, complain)
|
||||
tree lhstype, rhs;
|
||||
|
@ -5230,6 +5267,7 @@ instantiate_type (lhstype, rhs, complain)
|
|||
this may have to look back through base types to find the
|
||||
ultimate field name. (For single inheritance, these could
|
||||
all be the same name. Who knows for multiple inheritance). */
|
||||
|
||||
static tree
|
||||
get_vfield_name (type)
|
||||
tree type;
|
||||
|
|
|
@ -313,7 +313,7 @@ extern int flag_default_inline;
|
|||
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
|
||||
enum cplus_tree_code {
|
||||
__DUMMY = LAST_AND_UNUSED_TREE_CODE,
|
||||
#include "tree.def"
|
||||
#include "cp-tree.def"
|
||||
LAST_CPLUS_TREE_CODE
|
||||
};
|
||||
#undef DEFTREECODE
|
||||
|
@ -1352,8 +1352,7 @@ extern int flag_new_for_scope;
|
|||
0=normal declaration, e.g. int min (int, int);
|
||||
1=implicit template instantiation
|
||||
2=explicit template specialization, e.g. int min<int> (int, int);
|
||||
3=explicit template instantiation, e.g. template int min<int> (int, int);
|
||||
*/
|
||||
3=explicit template instantiation, e.g. template int min<int> (int, int); */
|
||||
#define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.use_template)
|
||||
|
||||
#define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1)
|
||||
|
|
645
gcc/cp/cvt.c
645
gcc/cp/cvt.c
File diff suppressed because it is too large
Load Diff
173
gcc/cp/decl.c
173
gcc/cp/decl.c
|
@ -473,8 +473,13 @@ extern int spew_debug;
|
|||
when entering another class scope (i.e. a cache miss). */
|
||||
extern tree previous_class_values;
|
||||
|
||||
/* A expression of value 0 with the same precision as a sizetype
|
||||
node, but signed. */
|
||||
tree signed_size_zero_node;
|
||||
|
||||
|
||||
/* Allocate a level of searching. */
|
||||
|
||||
struct stack_level *
|
||||
push_decl_level (stack, obstack)
|
||||
struct stack_level *stack;
|
||||
|
@ -487,24 +492,22 @@ push_decl_level (stack, obstack)
|
|||
}
|
||||
|
||||
/* For each binding contour we allocate a binding_level structure
|
||||
* which records the names defined in that contour.
|
||||
* Contours include:
|
||||
* 0) the global one
|
||||
* 1) one for each function definition,
|
||||
* where internal declarations of the parameters appear.
|
||||
* 2) one for each compound statement,
|
||||
* to record its declarations.
|
||||
*
|
||||
* The current meaning of a name can be found by searching the levels from
|
||||
* the current one out to the global one.
|
||||
*
|
||||
* Off to the side, may be the class_binding_level. This exists
|
||||
* only to catch class-local declarations. It is otherwise
|
||||
* nonexistent.
|
||||
*
|
||||
* Also there may be binding levels that catch cleanups that
|
||||
* must be run when exceptions occur.
|
||||
*/
|
||||
which records the names defined in that contour.
|
||||
Contours include:
|
||||
0) the global one
|
||||
1) one for each function definition,
|
||||
where internal declarations of the parameters appear.
|
||||
2) one for each compound statement,
|
||||
to record its declarations.
|
||||
|
||||
The current meaning of a name can be found by searching the levels
|
||||
from the current one out to the global one.
|
||||
|
||||
Off to the side, may be the class_binding_level. This exists only
|
||||
to catch class-local declarations. It is otherwise nonexistent.
|
||||
|
||||
Also there may be binding levels that catch cleanups that must be
|
||||
run when exceptions occur. */
|
||||
|
||||
/* Note that the information in the `names' component of the global contour
|
||||
is duplicated in the IDENTIFIER_GLOBAL_VALUEs of all identifiers. */
|
||||
|
@ -512,19 +515,18 @@ push_decl_level (stack, obstack)
|
|||
struct binding_level
|
||||
{
|
||||
/* A chain of _DECL nodes for all variables, constants, functions,
|
||||
* and typedef types. These are in the reverse of the order supplied.
|
||||
*/
|
||||
and typedef types. These are in the reverse of the order
|
||||
supplied. */
|
||||
tree names;
|
||||
|
||||
/* A list of structure, union and enum definitions,
|
||||
* for looking up tag names.
|
||||
* It is a chain of TREE_LIST nodes, each of whose TREE_PURPOSE is a name,
|
||||
* or NULL_TREE; and whose TREE_VALUE is a RECORD_TYPE, UNION_TYPE,
|
||||
* or ENUMERAL_TYPE node.
|
||||
*
|
||||
* C++: the TREE_VALUE nodes can be simple types for component_bindings.
|
||||
*
|
||||
*/
|
||||
/* A list of structure, union and enum definitions, for looking up
|
||||
tag names.
|
||||
It is a chain of TREE_LIST nodes, each of whose TREE_PURPOSE is a name,
|
||||
or NULL_TREE; and whose TREE_VALUE is a RECORD_TYPE, UNION_TYPE,
|
||||
or ENUMERAL_TYPE node.
|
||||
|
||||
C++: the TREE_VALUE nodes can be simple types for
|
||||
component_bindings. */
|
||||
tree tags;
|
||||
|
||||
/* For each level, a list of shadowed outer-level local definitions
|
||||
|
@ -1272,6 +1274,7 @@ poplevel (keep, reverse, functionbody)
|
|||
}
|
||||
|
||||
/* Resume a binding level for a namespace. */
|
||||
|
||||
void
|
||||
resume_level (b)
|
||||
struct binding_level *b;
|
||||
|
@ -1337,6 +1340,7 @@ insert_block (block)
|
|||
}
|
||||
|
||||
/* Add BLOCK to the current list of blocks for this binding contour. */
|
||||
|
||||
void
|
||||
add_block_current_level (block)
|
||||
tree block;
|
||||
|
@ -1356,6 +1360,7 @@ set_block (block)
|
|||
}
|
||||
|
||||
/* Do a pushlevel for class declarations. */
|
||||
|
||||
void
|
||||
pushlevel_class ()
|
||||
{
|
||||
|
@ -1397,6 +1402,7 @@ pushlevel_class ()
|
|||
|
||||
/* ...and a poplevel for class declarations. FORCE is used to force
|
||||
clearing out of CLASS_VALUEs after a class definition. */
|
||||
|
||||
tree
|
||||
poplevel_class (force)
|
||||
int force;
|
||||
|
@ -1613,6 +1619,7 @@ extern char * first_global_object_name;
|
|||
|
||||
/* Get a unique name for each call to this routine for unnamed namespaces.
|
||||
Mostly copied from get_file_function_name. */
|
||||
|
||||
static tree
|
||||
get_unique_name ()
|
||||
{
|
||||
|
@ -1654,6 +1661,7 @@ get_unique_name ()
|
|||
|
||||
/* Push into the scope of the NAME namespace. If NAME is NULL_TREE, then we
|
||||
select a name that is unique to this compilation unit. */
|
||||
|
||||
void
|
||||
push_namespace (name)
|
||||
tree name;
|
||||
|
@ -1697,6 +1705,7 @@ push_namespace (name)
|
|||
}
|
||||
|
||||
/* Pop from the scope of the current namespace. */
|
||||
|
||||
void
|
||||
pop_namespace ()
|
||||
{
|
||||
|
@ -1765,7 +1774,7 @@ struct saved_scope {
|
|||
};
|
||||
static struct saved_scope *current_saved_scope;
|
||||
|
||||
tree
|
||||
static tree
|
||||
store_bindings (names, old_bindings)
|
||||
tree names, old_bindings;
|
||||
{
|
||||
|
@ -1981,6 +1990,7 @@ set_identifier_type_value (id, type)
|
|||
/* Pop off extraneous binding levels left over due to syntax errors.
|
||||
|
||||
We don't pop past namespaces, as they might be valid. */
|
||||
|
||||
void
|
||||
pop_everything ()
|
||||
{
|
||||
|
@ -2142,10 +2152,12 @@ pushtag (name, type, globalize)
|
|||
}
|
||||
|
||||
/* Counter used to create anonymous type names. */
|
||||
|
||||
static int anon_cnt = 0;
|
||||
|
||||
/* Return an IDENTIFIER which can be used as a name for
|
||||
anonymous structs and unions. */
|
||||
|
||||
tree
|
||||
make_anon_name ()
|
||||
{
|
||||
|
@ -2157,6 +2169,7 @@ make_anon_name ()
|
|||
|
||||
/* Clear the TREE_PURPOSE slot of tags which have anonymous typenames.
|
||||
This keeps dbxout from getting confused. */
|
||||
|
||||
void
|
||||
clear_anon_tags ()
|
||||
{
|
||||
|
@ -2191,6 +2204,7 @@ clear_anon_tags ()
|
|||
For C++, we must compare the parameter list so that `int' can match
|
||||
`int&' in a parameter position, but `int&' is not confused with
|
||||
`const int&'. */
|
||||
|
||||
int
|
||||
decls_match (newdecl, olddecl)
|
||||
tree newdecl, olddecl;
|
||||
|
@ -2779,6 +2793,9 @@ duplicate_decls (newdecl, olddecl)
|
|||
|
||||
/* Merge the storage class information. */
|
||||
DECL_WEAK (newdecl) |= DECL_WEAK (olddecl);
|
||||
#ifdef DECL_ONE_ONLY
|
||||
DECL_ONE_ONLY (newdecl) |= DECL_ONE_ONLY (olddecl);
|
||||
#endif
|
||||
TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl);
|
||||
TREE_STATIC (olddecl) = TREE_STATIC (newdecl) |= TREE_STATIC (olddecl);
|
||||
if (! DECL_EXTERNAL (olddecl))
|
||||
|
@ -3348,6 +3365,7 @@ pushdecl_with_scope (x, level)
|
|||
|
||||
/* Like pushdecl, only it places X in GLOBAL_BINDING_LEVEL,
|
||||
if appropriate. */
|
||||
|
||||
tree
|
||||
pushdecl_top_level (x)
|
||||
tree x;
|
||||
|
@ -3391,6 +3409,7 @@ pushdecl_top_level (x)
|
|||
|
||||
/* Like push_overloaded_decl, only it places X in GLOBAL_BINDING_LEVEL,
|
||||
if appropriate. */
|
||||
|
||||
void
|
||||
push_overloaded_decl_top_level (x, forget)
|
||||
tree x;
|
||||
|
@ -3404,6 +3423,7 @@ push_overloaded_decl_top_level (x, forget)
|
|||
}
|
||||
|
||||
/* Make the declaration of X appear in CLASS scope. */
|
||||
|
||||
tree
|
||||
pushdecl_class_level (x)
|
||||
tree x;
|
||||
|
@ -3446,6 +3466,7 @@ pushdecl_class_level (x)
|
|||
/* This function is used to push the mangled decls for nested types into
|
||||
the appropriate scope. Previously pushdecl_top_level was used, but that
|
||||
is incorrect for members of local classes. */
|
||||
|
||||
void
|
||||
pushdecl_nonclass_level (x)
|
||||
tree x;
|
||||
|
@ -3465,6 +3486,7 @@ pushdecl_nonclass_level (x)
|
|||
|
||||
/* Make the declaration(s) of X appear in CLASS scope
|
||||
under the name NAME. */
|
||||
|
||||
void
|
||||
push_class_level_binding (name, x)
|
||||
tree name;
|
||||
|
@ -3485,6 +3507,7 @@ push_class_level_binding (name, x)
|
|||
|
||||
/* Tell caller how to interpret a TREE_LIST which contains
|
||||
chains of FUNCTION_DECLS. */
|
||||
|
||||
int
|
||||
overloaded_globals_p (list)
|
||||
tree list;
|
||||
|
@ -3513,6 +3536,7 @@ overloaded_globals_p (list)
|
|||
The value returned may be a previous declaration if we guessed wrong
|
||||
about what language DECL should belong to (C or C++). Otherwise,
|
||||
it's always DECL (and never something that's not a _DECL). */
|
||||
|
||||
tree
|
||||
push_overloaded_decl (decl, forgettable)
|
||||
tree decl;
|
||||
|
@ -3945,6 +3969,7 @@ pop_switch ()
|
|||
|
||||
/* Same, but for CASE labels. If DECL is NULL_TREE, it's the default. */
|
||||
/* XXX Note decl is never actually used. (bpk) */
|
||||
|
||||
void
|
||||
define_case_label (decl)
|
||||
tree decl;
|
||||
|
@ -4193,6 +4218,7 @@ lookup_tag_reverse (type, name)
|
|||
|
||||
/* Given type TYPE which was not declared in C++ language context,
|
||||
attempt to find a name by which it is referred. */
|
||||
|
||||
tree
|
||||
typedecl_for_tag (tag)
|
||||
tree tag;
|
||||
|
@ -4220,6 +4246,7 @@ typedecl_for_tag (tag)
|
|||
|
||||
/* Lookup TYPE in CONTEXT (a chain of nested types or a FUNCTION_DECL).
|
||||
Return the type value, or NULL_TREE if not found. */
|
||||
|
||||
static tree
|
||||
lookup_nested_type (type, context)
|
||||
tree type;
|
||||
|
@ -4260,6 +4287,7 @@ lookup_nested_type (type, context)
|
|||
}
|
||||
|
||||
/* Look up NAME in the NAMESPACE. */
|
||||
|
||||
tree
|
||||
lookup_namespace_name (namespace, name)
|
||||
tree namespace, name;
|
||||
|
@ -4416,7 +4444,7 @@ lookup_name_real (name, prefer_type, nonclass)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (got_scope)
|
||||
if (got_scope || val)
|
||||
goto done;
|
||||
|
||||
/* This special lookup only applies to types. */
|
||||
|
@ -4638,6 +4666,7 @@ record_builtin_type (rid_index, name, type)
|
|||
|
||||
/* Push overloaded decl, in global scope, with one argument so it
|
||||
can be used as a callback from define_function. */
|
||||
|
||||
static void
|
||||
push_overloaded_decl_1 (x)
|
||||
tree x;
|
||||
|
@ -4876,6 +4905,9 @@ init_decl_processing ()
|
|||
size_zero_node = size_int (0);
|
||||
size_one_node = size_int (1);
|
||||
|
||||
signed_size_zero_node = build_int_2 (0, 0);
|
||||
TREE_TYPE (signed_size_zero_node) = make_signed_type (TYPE_PRECISION (sizetype));
|
||||
|
||||
void_type_node = make_node (VOID_TYPE);
|
||||
record_builtin_type (RID_VOID, NULL_PTR, void_type_node);
|
||||
layout_type (void_type_node); /* Uses integer_zero_node. */
|
||||
|
@ -6017,8 +6049,10 @@ start_decl_1 (decl)
|
|||
|
||||
/* Handle initialization of references.
|
||||
These three arguments from from `cp_finish_decl', and have the
|
||||
same meaning here that they do there. */
|
||||
/* quotes on semantics can be found in ARM 8.4.3. */
|
||||
same meaning here that they do there.
|
||||
|
||||
Quotes on semantics can be found in ARM 8.4.3. */
|
||||
|
||||
static void
|
||||
grok_reference_init (decl, type, init, cleanupp)
|
||||
tree decl, type, init;
|
||||
|
@ -6792,6 +6826,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
|
|||
}
|
||||
|
||||
/* This is here for a midend callback from c-common.c */
|
||||
|
||||
void
|
||||
finish_decl (decl, init, asmspec_tree)
|
||||
tree decl, init;
|
||||
|
@ -6993,6 +7028,7 @@ complete_array_type (type, initial_value, do_default)
|
|||
/* Return zero if something is declared to be a member of type
|
||||
CTYPE when in the context of CUR_TYPE. STRING is the error
|
||||
message to print in that case. Otherwise, quietly return 1. */
|
||||
|
||||
static int
|
||||
member_function_or_else (ctype, cur_type, string)
|
||||
tree ctype, cur_type;
|
||||
|
@ -7010,6 +7046,7 @@ member_function_or_else (ctype, cur_type, string)
|
|||
|
||||
/* Generate errors possibly applicable for a given set of specifiers.
|
||||
This is for ARM $7.1.2. */
|
||||
|
||||
static void
|
||||
bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises)
|
||||
tree object;
|
||||
|
@ -7040,6 +7077,7 @@ bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises)
|
|||
RAISES is a list of exceptions that this function can raise.
|
||||
CHECK is 1 if we must find this method in CTYPE, 0 if we should
|
||||
not look, and -1 if we should not call `grokclassfn' at all. */
|
||||
|
||||
static tree
|
||||
grokfndecl (ctype, type, declarator, virtualp, flags, quals,
|
||||
raises, attrlist, check, publicp, inlinep, funcdef_flag)
|
||||
|
@ -9484,7 +9522,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, raises, attrli
|
|||
|
||||
if (TREE_CODE (type) == ARRAY_TYPE)
|
||||
{
|
||||
/* Transfer const-ness of array into that of type pointed to. */
|
||||
/* Transfer const-ness of array into that of type
|
||||
pointed to. */
|
||||
type = build_pointer_type
|
||||
(cp_build_type_variant (TREE_TYPE (type), constp, volatilep));
|
||||
volatilep = constp = 0;
|
||||
|
@ -9558,6 +9597,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, raises, attrli
|
|||
An empty exprlist is a parmlist. An exprlist which
|
||||
contains only identifiers at the global level
|
||||
is a parmlist. Otherwise, it is an exprlist. */
|
||||
|
||||
int
|
||||
parmlist_is_exprlist (exprs)
|
||||
tree exprs;
|
||||
|
@ -9584,6 +9624,7 @@ parmlist_is_exprlist (exprs)
|
|||
be complete.
|
||||
|
||||
C++: also subroutine of `start_function'. */
|
||||
|
||||
static void
|
||||
require_complete_types_for_parms (parms)
|
||||
tree parms;
|
||||
|
@ -9879,6 +9920,7 @@ grokparms (first_parm, funcdef_flag)
|
|||
`grok_op_properties' takes notice of the various forms of
|
||||
operator= which are defined, as well as what sorts of type conversion
|
||||
may apply. Both functions take a FUNCTION_DECL as an argument. */
|
||||
|
||||
int
|
||||
grok_ctor_properties (ctype, decl)
|
||||
tree ctype, decl;
|
||||
|
@ -9934,6 +9976,7 @@ grok_ctor_properties (ctype, decl)
|
|||
}
|
||||
|
||||
/* An operator with this name can be either unary or binary. */
|
||||
|
||||
static int
|
||||
ambi_op_p (name)
|
||||
tree name;
|
||||
|
@ -9947,6 +9990,7 @@ ambi_op_p (name)
|
|||
}
|
||||
|
||||
/* An operator with this name can only be unary. */
|
||||
|
||||
static int
|
||||
unary_op_p (name)
|
||||
tree name;
|
||||
|
@ -9958,6 +10002,7 @@ unary_op_p (name)
|
|||
}
|
||||
|
||||
/* Do a little sanity-checking on how they declared their operator. */
|
||||
|
||||
void
|
||||
grok_op_properties (decl, virtualp, friendp)
|
||||
tree decl;
|
||||
|
@ -10256,10 +10301,12 @@ xref_tag (code_type_node, name, binfo, globalize)
|
|||
if (t && TYPE_CONTEXT (t) && got_type)
|
||||
ref = t;
|
||||
else
|
||||
/* If we know we are defining this tag, only look it up in this scope
|
||||
* and don't try to find it as a type. */
|
||||
{
|
||||
/* If we know we are defining this tag, only look it up in
|
||||
this scope and don't try to find it as a type. */
|
||||
ref = lookup_tag (code, name, b, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (t)
|
||||
|
@ -10565,9 +10612,8 @@ start_enum (name)
|
|||
|
||||
current_local_enum = NULL_TREE;
|
||||
|
||||
/* We copy this value because enumerated type constants
|
||||
are really of the type of the enumerator, not integer_type_node. */
|
||||
enum_next_value = copy_node (integer_zero_node);
|
||||
/* We don't copy this value because build_enumerator needs to do it. */
|
||||
enum_next_value = integer_zero_node;
|
||||
enum_overflow = 0;
|
||||
|
||||
GNU_xref_decl (current_function_decl, enumtype);
|
||||
|
@ -10684,8 +10730,6 @@ build_enumerator (name, value)
|
|||
tree name, value;
|
||||
{
|
||||
tree decl, result;
|
||||
/* Change this to zero if we find VALUE is not shareable. */
|
||||
int shareable = 1;
|
||||
|
||||
/* Remove no-op casts from the value. */
|
||||
if (value)
|
||||
|
@ -10697,10 +10741,7 @@ build_enumerator (name, value)
|
|||
if (value != NULL_TREE)
|
||||
{
|
||||
if (TREE_READONLY_DECL_P (value))
|
||||
{
|
||||
value = decl_constant_value (value);
|
||||
shareable = 0;
|
||||
}
|
||||
|
||||
if (TREE_CODE (value) == INTEGER_CST)
|
||||
{
|
||||
|
@ -10714,9 +10755,6 @@ build_enumerator (name, value)
|
|||
}
|
||||
}
|
||||
|
||||
/* The order of things is reversed here so that we
|
||||
can check for possible sharing of enum values,
|
||||
to keep that from happening. */
|
||||
/* Default based on previous value. */
|
||||
if (value == NULL_TREE && ! current_template_parms)
|
||||
{
|
||||
|
@ -10729,19 +10767,11 @@ build_enumerator (name, value)
|
|||
if (value)
|
||||
STRIP_TYPE_NOPS (value);
|
||||
|
||||
/* Make up for hacks in lex.c. */
|
||||
if (value == integer_zero_node)
|
||||
value = build_int_2 (0, 0);
|
||||
else if (value == integer_one_node)
|
||||
value = build_int_2 (1, 0);
|
||||
else if (TREE_CODE (value) == INTEGER_CST
|
||||
&& (shareable == 0
|
||||
|| TREE_CODE (TREE_TYPE (value)) == ENUMERAL_TYPE))
|
||||
{
|
||||
/* We have to always copy here; not all INTEGER_CSTs are unshared,
|
||||
and there's no wedding ring. Look at size_int()...*/
|
||||
value = copy_node (value);
|
||||
TREE_TYPE (value) = integer_type_node;
|
||||
}
|
||||
}
|
||||
|
||||
/* C++ associates enums with global, function, or class declarations. */
|
||||
|
||||
|
@ -10774,9 +10804,6 @@ build_enumerator (name, value)
|
|||
enum_next_value = build_binary_op_nodefault (PLUS_EXPR, value,
|
||||
integer_one_node, PLUS_EXPR);
|
||||
enum_overflow = tree_int_cst_lt (enum_next_value, value);
|
||||
|
||||
if (enum_next_value == integer_one_node)
|
||||
enum_next_value = copy_node (enum_next_value);
|
||||
}
|
||||
|
||||
result = saveable_tree_cons (name, decl, NULL_TREE);
|
||||
|
@ -11386,6 +11413,7 @@ store_parm_decls ()
|
|||
|
||||
/* Bind a name and initialization to the return value of
|
||||
the current function. */
|
||||
|
||||
void
|
||||
store_return_init (return_id, init)
|
||||
tree return_id, init;
|
||||
|
@ -11450,7 +11478,10 @@ store_return_init (return_id, init)
|
|||
C++: CALL_POPLEVEL is non-zero if an extra call to poplevel
|
||||
(and expand_end_bindings) must be made to take care of the binding
|
||||
contour for the base initializers. This is only relevant for
|
||||
constructors. */
|
||||
constructors.
|
||||
|
||||
NESTED is nonzero if we were in the middle of compiling another function
|
||||
when we started on this one. */
|
||||
|
||||
void
|
||||
finish_function (lineno, call_poplevel, nested)
|
||||
|
@ -11470,6 +11501,9 @@ finish_function (lineno, call_poplevel, nested)
|
|||
if (fndecl == NULL_TREE)
|
||||
return;
|
||||
|
||||
if (! nested && function_depth > 1)
|
||||
nested = 1;
|
||||
|
||||
fntype = TREE_TYPE (fndecl);
|
||||
|
||||
/* TREE_READONLY (fndecl) = 1;
|
||||
|
@ -11567,10 +11601,10 @@ finish_function (lineno, call_poplevel, nested)
|
|||
if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type)
|
||||
|| TYPE_GETS_REG_DELETE (current_class_type))
|
||||
exprstmt = build_delete (current_class_type, current_class_ref, integer_zero_node,
|
||||
LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0);
|
||||
LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0);
|
||||
else
|
||||
exprstmt = build_delete (current_class_type, current_class_ref, in_charge_node,
|
||||
LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0);
|
||||
LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0);
|
||||
|
||||
/* If we did not assign to this, then `this' is non-zero at
|
||||
the end of a destructor. As a special optimization, don't
|
||||
|
@ -11602,9 +11636,13 @@ finish_function (lineno, call_poplevel, nested)
|
|||
if (TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (vbases)))
|
||||
{
|
||||
tree ptr = convert_pointer_to_vbase (BINFO_TYPE (vbases), current_class_ptr);
|
||||
expand_expr_stmt (build_delete (build_pointer_type (BINFO_TYPE (vbases)),
|
||||
expand_expr_stmt
|
||||
(build_delete
|
||||
(build_pointer_type (BINFO_TYPE (vbases)),
|
||||
ptr, integer_zero_node,
|
||||
LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_HAS_IN_CHARGE, 0));
|
||||
(LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR
|
||||
|LOOKUP_HAS_IN_CHARGE|LOOKUP_NORMAL),
|
||||
0));
|
||||
}
|
||||
vbases = TREE_CHAIN (vbases);
|
||||
}
|
||||
|
@ -12025,6 +12063,7 @@ finish_function (lineno, call_poplevel, nested)
|
|||
|
||||
DO NOT MAKE ANY CHANGES TO THIS CODE WITHOUT MAKING CORRESPONDING
|
||||
CHANGES TO CODE IN `grokfield'. */
|
||||
|
||||
tree
|
||||
start_method (declspecs, declarator, raises)
|
||||
tree declarator, declspecs, raises;
|
||||
|
@ -12242,6 +12281,7 @@ hack_incomplete_structures (type)
|
|||
|
||||
Don't build these on the momentary obstack; they must live
|
||||
the life of the binding contour. */
|
||||
|
||||
tree
|
||||
maybe_build_cleanup (decl)
|
||||
tree decl;
|
||||
|
@ -12292,9 +12332,8 @@ maybe_build_cleanup (decl)
|
|||
expressions are combined with other, type-providing, expressions,
|
||||
leaving only orphan expressions, such as:
|
||||
|
||||
&class::bar; / / takes its address, but does nothing with it.
|
||||
&class::bar; / / takes its address, but does nothing with it. */
|
||||
|
||||
*/
|
||||
void
|
||||
cplus_expand_expr_stmt (exp)
|
||||
tree exp;
|
||||
|
|
|
@ -157,11 +157,7 @@ int warn_ctor_dtor_privacy = 1;
|
|||
/* True if we want to implement vtables using "thunks".
|
||||
The default is off by default, on if explicitly supported. */
|
||||
|
||||
#ifdef ASM_OUTPUT_MI_THUNK
|
||||
int flag_vtable_thunks = 1;
|
||||
#else
|
||||
int flag_vtable_thunks;
|
||||
#endif
|
||||
|
||||
/* True if we want to deal with repository information. */
|
||||
|
||||
|
@ -628,6 +624,7 @@ lang_decode_option (p)
|
|||
/* Incorporate `const' and `volatile' qualifiers for member functions.
|
||||
FUNCTION is a TYPE_DECL or a FUNCTION_DECL.
|
||||
QUALS is a list of qualifiers. */
|
||||
|
||||
tree
|
||||
grok_method_quals (ctype, function, quals)
|
||||
tree ctype, function, quals;
|
||||
|
@ -680,6 +677,7 @@ grok_method_quals (ctype, function, quals)
|
|||
It leaves DECL_ASSEMBLER_NAMEs with the correct value. */
|
||||
/* This does not yet work with user defined conversion operators
|
||||
It should. */
|
||||
|
||||
static void
|
||||
substitute_nice_name (decl)
|
||||
tree decl;
|
||||
|
@ -697,6 +695,7 @@ substitute_nice_name (decl)
|
|||
/* Warn when -fexternal-templates is used and #pragma
|
||||
interface/implementation is not used all the times it should be,
|
||||
inform the user. */
|
||||
|
||||
void
|
||||
warn_if_unknown_interface (decl)
|
||||
tree decl;
|
||||
|
@ -727,6 +726,7 @@ warn_if_unknown_interface (decl)
|
|||
}
|
||||
|
||||
/* A subroutine of the parser, to handle a component list. */
|
||||
|
||||
tree
|
||||
grok_x_components (specs, components)
|
||||
tree specs, components;
|
||||
|
@ -1004,6 +1004,7 @@ grokclassfn (ctype, cname, function, flags, quals)
|
|||
}
|
||||
|
||||
/* Work on the expr used by alignof (this is only called by the parser). */
|
||||
|
||||
tree
|
||||
grok_alignof (expr)
|
||||
tree expr;
|
||||
|
@ -1047,6 +1048,7 @@ grok_alignof (expr)
|
|||
|
||||
/* Create an ARRAY_REF, checking for the user doing things backwards
|
||||
along the way. */
|
||||
|
||||
tree
|
||||
grok_array_decl (array_expr, index_exp)
|
||||
tree array_expr, index_exp;
|
||||
|
@ -1120,6 +1122,7 @@ grok_array_decl (array_expr, index_exp)
|
|||
for doing an array delete. If DOING_VEC is 2, they gave us the
|
||||
array size as an argument to delete.
|
||||
Implements ARM $5.3.4. This is called from the parser. */
|
||||
|
||||
tree
|
||||
delete_sanity (exp, size, doing_vec, use_global_delete)
|
||||
tree exp, size;
|
||||
|
@ -1643,6 +1646,7 @@ grokbitfield (declarator, declspecs, width)
|
|||
buried in DECLSPECS. Find the declarator, and
|
||||
return something that looks like it came from
|
||||
GROKFIELD. */
|
||||
|
||||
tree
|
||||
groktypefield (declspecs, parmlist)
|
||||
tree declspecs;
|
||||
|
@ -1971,6 +1975,7 @@ cplus_decl_attributes (decl, attributes, prefix_attributes)
|
|||
specified class. Argument can be RECORD_TYPE, TYPE_DECL, or
|
||||
IDENTIFIER_NODE. When given a template, this routine doesn't
|
||||
lose the specialization. */
|
||||
|
||||
tree
|
||||
constructor_name_full (thing)
|
||||
tree thing;
|
||||
|
@ -1997,6 +2002,7 @@ constructor_name_full (thing)
|
|||
specified class. Argument can be RECORD_TYPE, TYPE_DECL, or
|
||||
IDENTIFIER_NODE. When given a template, return the plain
|
||||
unspecialized name. */
|
||||
|
||||
tree
|
||||
constructor_name (thing)
|
||||
tree thing;
|
||||
|
@ -2012,6 +2018,7 @@ constructor_name (thing)
|
|||
/* Cache the value of this class's main virtual function table pointer
|
||||
in a register variable. This will save one indirection if a
|
||||
more than one virtual function call is made this function. */
|
||||
|
||||
void
|
||||
setup_vtbl_ptr ()
|
||||
{
|
||||
|
@ -2030,6 +2037,7 @@ setup_vtbl_ptr ()
|
|||
}
|
||||
|
||||
/* Record the existence of an addressable inline function. */
|
||||
|
||||
void
|
||||
mark_inline_for_output (decl)
|
||||
tree decl;
|
||||
|
@ -2118,6 +2126,7 @@ get_temp_name (type, staticp)
|
|||
It is not entered into current_binding_level, because
|
||||
that breaks things when it comes time to do final cleanups
|
||||
(which take place "outside" the binding contour of the function). */
|
||||
|
||||
tree
|
||||
get_temp_regvar (type, init)
|
||||
tree type, init;
|
||||
|
@ -2143,6 +2152,7 @@ get_temp_regvar (type, init)
|
|||
|
||||
/* Make the macro TEMP_NAME_P available to units which do not
|
||||
include c-tree.h. */
|
||||
|
||||
int
|
||||
temp_name_p (decl)
|
||||
tree decl;
|
||||
|
@ -2156,6 +2166,7 @@ temp_name_p (decl)
|
|||
union is an anonymous union, we arrange for that
|
||||
as well. PUBLIC_P is nonzero if this union is
|
||||
not declared static. */
|
||||
|
||||
void
|
||||
finish_anon_union (anon_union_decl)
|
||||
tree anon_union_decl;
|
||||
|
@ -2240,6 +2251,7 @@ finish_anon_union (anon_union_decl)
|
|||
TYPE is the type of the table entry.
|
||||
INIT is all the elements in the table.
|
||||
PUBLICP is non-zero if this table should be given external access. */
|
||||
|
||||
tree
|
||||
finish_table (name, type, init, publicp)
|
||||
tree name, type, init;
|
||||
|
@ -2316,6 +2328,7 @@ finish_table (name, type, init, publicp)
|
|||
used in FIELDS.
|
||||
|
||||
It is given the same alignment as ALIGN_TYPE. */
|
||||
|
||||
void
|
||||
finish_builtin_type (type, name, fields, len, align_type)
|
||||
tree type;
|
||||
|
@ -2601,7 +2614,8 @@ finish_vtable_vardecl (prev, vars)
|
|||
&& ! DECL_ONE_ONLY (vars)
|
||||
#endif
|
||||
)
|
||||
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars)))
|
||||
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars))
|
||||
|| (hack_decl_function_context (vars) && TREE_USED (vars)))
|
||||
&& ! TREE_ASM_WRITTEN (vars))
|
||||
{
|
||||
/* Write it out. */
|
||||
|
@ -2747,7 +2761,8 @@ import_export_decl (decl)
|
|||
if (DECL_TEMPLATE_INSTANTIATION (decl))
|
||||
{
|
||||
DECL_NOT_REALLY_EXTERN (decl) = 1;
|
||||
if (DECL_IMPLICIT_INSTANTIATION (decl) && flag_implicit_templates)
|
||||
if (DECL_IMPLICIT_INSTANTIATION (decl)
|
||||
&& (flag_implicit_templates || DECL_THIS_INLINE (decl)))
|
||||
{
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL)
|
||||
{
|
||||
|
@ -2922,6 +2937,14 @@ finish_file ()
|
|||
for (fnname = pending_templates; fnname; fnname = TREE_CHAIN (fnname))
|
||||
{
|
||||
tree decl = TREE_VALUE (fnname);
|
||||
if (TREE_CODE_CLASS (TREE_CODE (decl)) == 't')
|
||||
{
|
||||
instantiate_class_template (decl);
|
||||
if (CLASSTYPE_TEMPLATE_INSTANTIATION (decl))
|
||||
for (vars = TYPE_METHODS (decl); vars; vars = TREE_CHAIN (vars))
|
||||
instantiate_decl (vars);
|
||||
}
|
||||
else
|
||||
instantiate_decl (decl);
|
||||
}
|
||||
|
||||
|
@ -3329,6 +3352,7 @@ finish_file ()
|
|||
|
||||
Maybe this shouldn't be recursive, but how often will it actually be
|
||||
used? (jason) */
|
||||
|
||||
tree
|
||||
reparse_absdcl_as_expr (type, decl)
|
||||
tree type, decl;
|
||||
|
@ -3355,6 +3379,7 @@ reparse_absdcl_as_expr (type, decl)
|
|||
|
||||
In the above example, DECL is the `(int)(int)(int)', and EXPR is the
|
||||
`1'. */
|
||||
|
||||
tree
|
||||
reparse_absdcl_as_casts (decl, expr)
|
||||
tree decl, expr;
|
||||
|
@ -3424,6 +3449,18 @@ build_expr_from_tree (t)
|
|||
return build_reinterpret_cast
|
||||
(TREE_TYPE (t), build_expr_from_tree (TREE_OPERAND (t, 0)));
|
||||
|
||||
case CONST_CAST_EXPR:
|
||||
return build_const_cast
|
||||
(TREE_TYPE (t), build_expr_from_tree (TREE_OPERAND (t, 0)));
|
||||
|
||||
case DYNAMIC_CAST_EXPR:
|
||||
return build_dynamic_cast
|
||||
(TREE_TYPE (t), build_expr_from_tree (TREE_OPERAND (t, 0)));
|
||||
|
||||
case STATIC_CAST_EXPR:
|
||||
return build_static_cast
|
||||
(TREE_TYPE (t), build_expr_from_tree (TREE_OPERAND (t, 0)));
|
||||
|
||||
case PREDECREMENT_EXPR:
|
||||
case PREINCREMENT_EXPR:
|
||||
case POSTDECREMENT_EXPR:
|
||||
|
@ -3608,6 +3645,7 @@ build_expr_from_tree (t)
|
|||
build_expr_from_tree, above.
|
||||
|
||||
In the above example, TYPE is `int' and DECL is `*a'. */
|
||||
|
||||
tree
|
||||
reparse_decl_as_expr (type, decl)
|
||||
tree type, decl;
|
||||
|
@ -3692,6 +3730,7 @@ tree current_namespace;
|
|||
|
||||
/* Get the inner part of a namespace id. It doesn't have any prefix, nor
|
||||
postfix. Returns 0 if in global namespace. */
|
||||
|
||||
tree
|
||||
get_namespace_id ()
|
||||
{
|
||||
|
@ -3702,6 +3741,7 @@ get_namespace_id ()
|
|||
}
|
||||
|
||||
/* Build up a DECL_ASSEMBLER_NAME for NAME in the current namespace. */
|
||||
|
||||
tree
|
||||
current_namespace_id (name)
|
||||
tree name;
|
||||
|
|
|
@ -122,6 +122,7 @@ dump_readonly_or_volatile (t, p)
|
|||
static char digit_buffer[128];
|
||||
|
||||
/* Dump into the obstack a human-readable equivalent of TYPE. */
|
||||
|
||||
static void
|
||||
dump_type (t, v)
|
||||
tree t;
|
||||
|
@ -260,6 +261,7 @@ aggr_variety (t)
|
|||
}
|
||||
|
||||
/* Print out a class declaration, in the form `class foo'. */
|
||||
|
||||
static void
|
||||
dump_aggr_type (t, v)
|
||||
tree t;
|
||||
|
@ -515,6 +517,7 @@ dump_type_suffix (t, v)
|
|||
|
||||
/* Return a function declaration which corresponds to the IDENTIFIER_NODE
|
||||
argument. */
|
||||
|
||||
tree
|
||||
ident_fndecl (t)
|
||||
tree t;
|
||||
|
@ -834,6 +837,7 @@ dump_function_decl (t, v)
|
|||
|
||||
/* Handle the function name for a FUNCTION_DECL node, grokking operators
|
||||
and destructors properly. */
|
||||
|
||||
static void
|
||||
dump_function_name (t)
|
||||
tree t;
|
||||
|
@ -917,6 +921,7 @@ dump_char (c)
|
|||
}
|
||||
|
||||
/* Print out a list of initializers (subr of dump_expr) */
|
||||
|
||||
static void
|
||||
dump_expr_list (l)
|
||||
tree l;
|
||||
|
@ -931,6 +936,7 @@ dump_expr_list (l)
|
|||
}
|
||||
|
||||
/* Print out an expression */
|
||||
|
||||
static void
|
||||
dump_expr (t, nop)
|
||||
tree t;
|
||||
|
@ -1377,6 +1383,7 @@ fndecl_as_string (fndecl, print_ret_type_p)
|
|||
/* Same, but handtype a _TYPE.
|
||||
Called from convert_to_reference, mangle_class_name_for_template,
|
||||
build_unary_op, and GNU_xref_decl. */
|
||||
|
||||
char *
|
||||
type_as_string (typ, v)
|
||||
tree typ;
|
||||
|
@ -1407,6 +1414,7 @@ expr_as_string (decl, v)
|
|||
|
||||
/* A cross between type_as_string and fndecl_as_string.
|
||||
Only called from substitute_nice_name. */
|
||||
|
||||
char *
|
||||
decl_as_string (decl, v)
|
||||
tree decl;
|
||||
|
@ -1482,6 +1490,7 @@ language_as_string (c, v)
|
|||
}
|
||||
|
||||
/* Return the proper printed version of a parameter to a C++ function. */
|
||||
|
||||
char *
|
||||
parm_as_string (p, v)
|
||||
int p, v;
|
||||
|
|
|
@ -1614,6 +1614,7 @@ tree
|
|||
start_anon_func ()
|
||||
{
|
||||
static int counter = 0;
|
||||
int old_interface_unknown = interface_unknown;
|
||||
char name[32];
|
||||
tree params;
|
||||
tree t;
|
||||
|
@ -1624,6 +1625,8 @@ start_anon_func ()
|
|||
/* No need to mangle this. */
|
||||
push_lang_context (lang_name_c);
|
||||
|
||||
interface_unknown = 1;
|
||||
|
||||
params = void_list_node;
|
||||
/* tcf stands for throw clean funciton. */
|
||||
sprintf (name, "__tcf_%d", counter++);
|
||||
|
@ -1638,6 +1641,8 @@ start_anon_func ()
|
|||
expand_start_bindings (0);
|
||||
emit_line_note (input_filename, lineno);
|
||||
|
||||
interface_unknown = old_interface_unknown;
|
||||
|
||||
pop_lang_context ();
|
||||
|
||||
return current_function_decl;
|
||||
|
|
|
@ -116,6 +116,7 @@ void init_init_processing ()
|
|||
|
||||
Relies upon binfo being inside TYPE_BINFO (TREE_TYPE (TREE_TYPE
|
||||
(addr))). */
|
||||
|
||||
void
|
||||
expand_direct_vtbls_init (real_binfo, binfo, init_self, can_elide, addr)
|
||||
tree real_binfo, binfo, addr;
|
||||
|
@ -150,6 +151,7 @@ expand_direct_vtbls_init (real_binfo, binfo, init_self, can_elide, addr)
|
|||
|
||||
/* 348 - 351 */
|
||||
/* Subroutine of emit_base_init. */
|
||||
|
||||
static void
|
||||
perform_member_init (member, name, init, explicit, protect_list)
|
||||
tree member, name, init;
|
||||
|
@ -252,6 +254,7 @@ perform_member_init (member, name, init, explicit, protect_list)
|
|||
extern int warn_reorder;
|
||||
|
||||
/* Subroutine of emit_member_init. */
|
||||
|
||||
static tree
|
||||
sort_member_init (t)
|
||||
tree t;
|
||||
|
@ -482,6 +485,7 @@ sort_base_init (t, rbase_ptr, vbase_ptr)
|
|||
}
|
||||
|
||||
/* Perform partial cleanups for a base for exception handling. */
|
||||
|
||||
static tree
|
||||
build_partial_cleanup_for (binfo)
|
||||
tree binfo;
|
||||
|
@ -735,6 +739,7 @@ emit_base_init (t, immediately)
|
|||
|
||||
/* Check that all fields are properly initialized after
|
||||
an assignment to `this'. */
|
||||
|
||||
void
|
||||
check_base_init (t)
|
||||
tree t;
|
||||
|
@ -751,6 +756,7 @@ check_base_init (t)
|
|||
|
||||
BINFO is the exact type that DECL is supposed to be. In
|
||||
multiple inheritance, this might mean "C's A" if C : A, B. */
|
||||
|
||||
static void
|
||||
expand_virtual_init (binfo, decl)
|
||||
tree binfo, decl;
|
||||
|
@ -781,6 +787,7 @@ expand_virtual_init (binfo, decl)
|
|||
/* Subroutine of `expand_aggr_vbase_init'.
|
||||
BINFO is the binfo of the type that is being initialized.
|
||||
INIT_LIST is the list of initializers for the virtual baseclass. */
|
||||
|
||||
static void
|
||||
expand_aggr_vbase_init_1 (binfo, exp, addr, init_list)
|
||||
tree binfo, exp, addr, init_list;
|
||||
|
@ -817,6 +824,7 @@ expand_aggr_vbase_init_1 (binfo, exp, addr, init_list)
|
|||
done only at the top-level of the object being constructed.
|
||||
|
||||
INIT_LIST is list of initialization for constructor to perform. */
|
||||
|
||||
static void
|
||||
expand_aggr_vbase_init (binfo, exp, addr, init_list)
|
||||
tree binfo;
|
||||
|
@ -849,6 +857,7 @@ expand_aggr_vbase_init (binfo, exp, addr, init_list)
|
|||
S_ID is the scoped identifier.
|
||||
NAME is the name of the member.
|
||||
INIT is the initializer, or `void_type_node' if none. */
|
||||
|
||||
void
|
||||
do_member_init (s_id, name, init)
|
||||
tree s_id, name, init;
|
||||
|
@ -873,6 +882,7 @@ do_member_init (s_id, name, init)
|
|||
}
|
||||
|
||||
/* Find the context in which this FIELD can be initialized. */
|
||||
|
||||
static tree
|
||||
initializing_context (field)
|
||||
tree field;
|
||||
|
@ -932,6 +942,7 @@ member_init_ok_or_else (field, type, member_name)
|
|||
If INIT is non-NULL, then it the initialization should
|
||||
be placed in `current_base_init_list', where it will be processed
|
||||
by `emit_base_init'. */
|
||||
|
||||
void
|
||||
expand_member_init (exp, name, init)
|
||||
tree exp, name, init;
|
||||
|
@ -986,7 +997,7 @@ expand_member_init (exp, name, init)
|
|||
|
||||
if (name == NULL_TREE)
|
||||
{
|
||||
/*
|
||||
#if 0
|
||||
if (basetype)
|
||||
name = TYPE_IDENTIFIER (basetype);
|
||||
else
|
||||
|
@ -994,7 +1005,7 @@ expand_member_init (exp, name, init)
|
|||
error ("no base class to initialize");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1518,6 +1529,8 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NEW_OVER
|
||||
/* See whether we can go through a type conversion operator.
|
||||
This wins over going through a non-existent constructor. If
|
||||
there is a constructor, it is ambiguous. */
|
||||
|
@ -1550,6 +1563,7 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* We know that expand_default_init can handle everything we want
|
||||
|
@ -1559,6 +1573,7 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
|
|||
|
||||
/* Report an error if NAME is not the name of a user-defined,
|
||||
aggregate type. If OR_ELSE is nonzero, give an error message. */
|
||||
|
||||
int
|
||||
is_aggr_typedef (name, or_else)
|
||||
tree name;
|
||||
|
@ -1590,6 +1605,7 @@ is_aggr_typedef (name, or_else)
|
|||
|
||||
/* Report an error if TYPE is not a user-defined, aggregate type. If
|
||||
OR_ELSE is nonzero, give an error message. */
|
||||
|
||||
int
|
||||
is_aggr_type (type, or_else)
|
||||
tree type;
|
||||
|
@ -1609,6 +1625,7 @@ is_aggr_type (type, or_else)
|
|||
}
|
||||
|
||||
/* Like is_aggr_typedef, but returns typedef if successful. */
|
||||
|
||||
tree
|
||||
get_aggr_from_typedef (name, or_else)
|
||||
tree name;
|
||||
|
@ -1657,6 +1674,7 @@ get_type_value (name)
|
|||
|
||||
/* For an expression of the form TYPE :: NAME (PARMLIST), build
|
||||
the appropriate function call. */
|
||||
|
||||
tree
|
||||
build_member_call (type, name, parmlist)
|
||||
tree type, name, parmlist;
|
||||
|
@ -1779,6 +1797,7 @@ build_member_call (type, name, parmlist)
|
|||
@@ fields.
|
||||
|
||||
@@ This function should be rewritten and placed in search.c. */
|
||||
|
||||
tree
|
||||
build_offset_ref (type, name)
|
||||
tree type, name;
|
||||
|
@ -2235,6 +2254,7 @@ is_friend (type, supplicant)
|
|||
|
||||
/* Add a new friend to the friends of the aggregate type TYPE.
|
||||
DECL is the FUNCTION_DECL of the friend being added. */
|
||||
|
||||
static void
|
||||
add_friend (type, decl)
|
||||
tree type, decl;
|
||||
|
@ -2284,6 +2304,7 @@ add_friend (type, decl)
|
|||
|
||||
/* Declare that every member function NAME in FRIEND_TYPE
|
||||
(which may be NULL_TREE) is a friend of type TYPE. */
|
||||
|
||||
static void
|
||||
add_friends (type, name, friend_type)
|
||||
tree type, name, friend_type;
|
||||
|
@ -2336,6 +2357,7 @@ add_friends (type, name, friend_type)
|
|||
then the DECL_WAITING_FRIENDS contains a list of types
|
||||
waiting to make it their friend. Note that these two can both
|
||||
be in use at the same time! */
|
||||
|
||||
void
|
||||
make_friend_class (type, friend_type)
|
||||
tree type, friend_type;
|
||||
|
@ -2395,6 +2417,7 @@ make_friend_class (type, friend_type)
|
|||
|
||||
QUALS say what special qualifies should apply to the object
|
||||
pointed to by `this'. */
|
||||
|
||||
tree
|
||||
do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
|
||||
tree ctype, declarator, decl, parmdecls;
|
||||
|
@ -3045,7 +3068,7 @@ build_vec_delete_1 (base, maxindex, type, auto_delete_vec, auto_delete,
|
|||
int use_global_delete;
|
||||
{
|
||||
tree virtual_size;
|
||||
tree ptype = build_pointer_type (type);
|
||||
tree ptype = build_pointer_type (type = complete_type (type));
|
||||
tree size_exp = size_in_bytes (type);
|
||||
|
||||
/* Temporary variables used by the loop. */
|
||||
|
@ -3196,6 +3219,7 @@ build_vec_delete_1 (base, maxindex, type, auto_delete_vec, auto_delete,
|
|||
BASE is that starting address of the array.
|
||||
COUNT is the count of objects that have been built, that need destroying.
|
||||
TYPE is the type of elements in the array. */
|
||||
|
||||
static tree
|
||||
build_array_eh_cleanup (base, count, type)
|
||||
tree base, count, type;
|
||||
|
@ -3261,7 +3285,7 @@ expand_vec_init (decl, base, maxindex, init, from_array)
|
|||
|
||||
if (init != NULL_TREE
|
||||
&& TREE_CODE (init) == CONSTRUCTOR
|
||||
&& TREE_TYPE (init) == TREE_TYPE (decl))
|
||||
&& (! decl || TREE_TYPE (init) == TREE_TYPE (decl)))
|
||||
{
|
||||
/* Initialization of array from {...}. */
|
||||
tree elts = CONSTRUCTOR_ELTS (init);
|
||||
|
@ -3453,6 +3477,7 @@ expand_vec_init (decl, base, maxindex, init, from_array)
|
|||
static object, see Free Store 12.5 ANSI C++ WP.
|
||||
|
||||
This does not call any destructors. */
|
||||
|
||||
tree
|
||||
build_x_delete (type, addr, which_delete, virtual_size)
|
||||
tree type, addr;
|
||||
|
@ -3484,6 +3509,7 @@ build_x_delete (type, addr, which_delete, virtual_size)
|
|||
flags. See cp-tree.h for more info.
|
||||
|
||||
This function does not delete an object's virtual base classes. */
|
||||
|
||||
tree
|
||||
build_delete (type, addr, auto_delete, flags, use_global_delete)
|
||||
tree type, addr;
|
||||
|
@ -3491,7 +3517,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
|
|||
int flags;
|
||||
int use_global_delete;
|
||||
{
|
||||
tree function, parms;
|
||||
tree function;
|
||||
tree member;
|
||||
tree expr;
|
||||
tree ref;
|
||||
|
@ -3587,15 +3613,14 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
|
|||
return build_builtin_call (void_type_node, BID,
|
||||
build_tree_list (NULL_TREE, addr));
|
||||
}
|
||||
parms = build_tree_list (NULL_TREE, addr);
|
||||
|
||||
/* Below, we will reverse the order in which these calls are made.
|
||||
If we have a destructor, then that destructor will take care
|
||||
of the base classes; otherwise, we must do that here. */
|
||||
if (TYPE_HAS_DESTRUCTOR (type))
|
||||
{
|
||||
tree parms = build_tree_list (NULL_TREE, addr);
|
||||
tree dtor = DECL_MAIN_VARIANT (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), 1));
|
||||
tree basetypes = TYPE_BINFO (type);
|
||||
tree passed_auto_delete;
|
||||
tree do_delete = NULL_TREE;
|
||||
|
||||
|
@ -3619,7 +3644,13 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
|
|||
|
||||
if (flags & LOOKUP_PROTECT)
|
||||
{
|
||||
tree access = compute_access (basetypes, dtor);
|
||||
tree access;
|
||||
tree basetypes = NULL_TREE;
|
||||
if (current_class_type != NULL_TREE)
|
||||
basetypes = get_binfo (type, current_class_type, 0);
|
||||
if (basetypes == NULL_TREE)
|
||||
basetypes = TYPE_BINFO (type);
|
||||
access = compute_access (basetypes, dtor);
|
||||
|
||||
if (access == access_private_node)
|
||||
{
|
||||
|
@ -3863,6 +3894,7 @@ build_vbase_delete (type, decl)
|
|||
values we'd have to extract. (We could use MAXINDEX with pointers to
|
||||
confirm the size, and trap if the numbers differ; not clear that it'd
|
||||
be worth bothering.) */
|
||||
|
||||
tree
|
||||
build_vec_delete (base, maxindex, auto_delete_vec, auto_delete,
|
||||
use_global_delete)
|
||||
|
|
43
gcc/cp/lex.c
43
gcc/cp/lex.c
|
@ -301,13 +301,13 @@ my_get_run_time ()
|
|||
|
||||
/* Table indexed by tree code giving a string containing a character
|
||||
classifying the tree code. Possibilities are
|
||||
t, d, s, c, r, <, 1 and 2. See cp/tree.def for details. */
|
||||
t, d, s, c, r, <, 1 and 2. See cp/cp-tree.def for details. */
|
||||
|
||||
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
|
||||
|
||||
char *cplus_tree_code_type[] = {
|
||||
"x",
|
||||
#include "tree.def"
|
||||
#include "cp-tree.def"
|
||||
};
|
||||
#undef DEFTREECODE
|
||||
|
||||
|
@ -319,7 +319,7 @@ char *cplus_tree_code_type[] = {
|
|||
|
||||
int cplus_tree_code_length[] = {
|
||||
0,
|
||||
#include "tree.def"
|
||||
#include "cp-tree.def"
|
||||
};
|
||||
#undef DEFTREECODE
|
||||
|
||||
|
@ -329,7 +329,7 @@ int cplus_tree_code_length[] = {
|
|||
|
||||
char *cplus_tree_code_name[] = {
|
||||
"@@dummy",
|
||||
#include "tree.def"
|
||||
#include "cp-tree.def"
|
||||
};
|
||||
#undef DEFTREECODE
|
||||
|
||||
|
@ -374,6 +374,7 @@ init_filename_times ()
|
|||
/* Change by Bryan Boreham, Kewill, Thu Jul 27 09:46:05 1989.
|
||||
Stuck this hack in to get the files open correctly; this is called
|
||||
in place of init_lex if we are an unexec'd binary. */
|
||||
|
||||
void
|
||||
reinit_lang_specific ()
|
||||
{
|
||||
|
@ -937,13 +938,13 @@ print_parse_statistics ()
|
|||
qsort (sorted, TOKEN_LENGTH, sizeof (int), token_cmp);
|
||||
for (i = 0; i < TOKEN_LENGTH; i++)
|
||||
{
|
||||
int index = sorted[i];
|
||||
if (token_count[index] == 0)
|
||||
int idx = sorted[i];
|
||||
if (token_count[idx] == 0)
|
||||
break;
|
||||
if (token_count[index] < token_count[-1])
|
||||
if (token_count[idx] < token_count[-1])
|
||||
break;
|
||||
fprintf (stderr, "token %d, `%s', count = %d\n",
|
||||
index, yytname[YYTRANSLATE (index)], token_count[index]);
|
||||
idx, yytname[YYTRANSLATE (idx)], token_count[idx]);
|
||||
}
|
||||
fprintf (stderr, "\n");
|
||||
for (i = 0; i < REDUCE_LENGTH; i++)
|
||||
|
@ -951,13 +952,13 @@ print_parse_statistics ()
|
|||
qsort (sorted, REDUCE_LENGTH, sizeof (int), reduce_cmp);
|
||||
for (i = 0; i < REDUCE_LENGTH; i++)
|
||||
{
|
||||
int index = sorted[i];
|
||||
if (reduce_count[index] == 0)
|
||||
int idx = sorted[i];
|
||||
if (reduce_count[idx] == 0)
|
||||
break;
|
||||
if (reduce_count[index] < reduce_count[-1])
|
||||
if (reduce_count[idx] < reduce_count[-1])
|
||||
break;
|
||||
fprintf (stderr, "rule %d, line %d, count = %d\n",
|
||||
index, yyrline[index], reduce_count[index]);
|
||||
idx, yyrline[idx], reduce_count[idx]);
|
||||
}
|
||||
fprintf (stderr, "\n");
|
||||
#endif
|
||||
|
@ -968,6 +969,7 @@ print_parse_statistics ()
|
|||
/* Sets the value of the 'yydebug' variable to VALUE.
|
||||
This is a function so we don't have to have YYDEBUG defined
|
||||
in order to build the compiler. */
|
||||
|
||||
void
|
||||
set_yydebug (value)
|
||||
int value;
|
||||
|
@ -1010,6 +1012,7 @@ static struct impl_files *impl_file_chain;
|
|||
|
||||
/* Helper function to load global variables with interface
|
||||
information. */
|
||||
|
||||
void
|
||||
extract_interface_info ()
|
||||
{
|
||||
|
@ -1031,6 +1034,7 @@ extract_interface_info ()
|
|||
|
||||
/* Return nonzero if S is not considered part of an
|
||||
INTERFACE/IMPLEMENTATION pair. Otherwise, return 0. */
|
||||
|
||||
static int
|
||||
interface_strcmp (s)
|
||||
char *s;
|
||||
|
@ -1104,6 +1108,7 @@ set_vardecl_interface_info (prev, vars)
|
|||
do, set up to process them now. This function sets up the first function
|
||||
to be parsed; after it has been, the rule for fndef in parse.y will
|
||||
call process_next_inline to start working on the next one. */
|
||||
|
||||
void
|
||||
do_pending_inlines ()
|
||||
{
|
||||
|
@ -1168,6 +1173,7 @@ static int nextchar = -1;
|
|||
/* Called from the fndecl rule in the parser when the function just parsed
|
||||
was declared using a PRE_PARSED_FUNCTION_DECL (i.e. came from
|
||||
do_pending_inlines). */
|
||||
|
||||
void
|
||||
process_next_inline (t)
|
||||
tree t;
|
||||
|
@ -1183,12 +1189,11 @@ process_next_inline (t)
|
|||
if (yychar != END_OF_SAVED_INPUT)
|
||||
{
|
||||
error ("parse error at end of saved function text");
|
||||
|
||||
/* restore_pending_input will abort unless yychar is either
|
||||
* END_OF_SAVED_INPUT or YYEMPTY; since we already know we're
|
||||
* hosed, feed back YYEMPTY.
|
||||
* We also need to discard nextchar, since that may have gotten
|
||||
* set as well.
|
||||
*/
|
||||
END_OF_SAVED_INPUT or YYEMPTY; since we already know we're
|
||||
hosed, feed back YYEMPTY. We also need to discard nextchar,
|
||||
since that may have gotten set as well. */
|
||||
nextchar = -1;
|
||||
}
|
||||
yychar = YYEMPTY;
|
||||
|
@ -1322,6 +1327,7 @@ restore_pending_input (p)
|
|||
|
||||
/* Return next non-whitespace input character, which may come
|
||||
from `finput', or from `nextchar'. */
|
||||
|
||||
static int
|
||||
yynextch ()
|
||||
{
|
||||
|
@ -1339,6 +1345,7 @@ yynextch ()
|
|||
/* Unget character CH from the input stream.
|
||||
If RESCAN is non-zero, then we want to `see' this
|
||||
character as the next input token. */
|
||||
|
||||
void
|
||||
yyungetc (ch, rescan)
|
||||
int ch;
|
||||
|
@ -1733,6 +1740,7 @@ cons_up_default_function (type, full_name, kind)
|
|||
/* Heuristic to tell whether the user is missing a semicolon
|
||||
after a struct or enum declaration. Emit an error message
|
||||
if we know the user has blown it. */
|
||||
|
||||
void
|
||||
check_for_missing_semicolon (type)
|
||||
tree type;
|
||||
|
@ -4485,6 +4493,7 @@ handle_cp_pragma (pname)
|
|||
|
||||
/* This function has to be in this file, in order to get at
|
||||
the token types. */
|
||||
|
||||
int
|
||||
handle_sysv_pragma (finput, token)
|
||||
FILE *finput;
|
||||
|
|
|
@ -63,7 +63,8 @@ enum rid
|
|||
RID_AUTO,
|
||||
RID_MUTABLE,
|
||||
|
||||
/* This is where grokdeclarator ends its search when setting the specbits. */
|
||||
/* This is where grokdeclarator ends its search when setting the
|
||||
specbits. */
|
||||
|
||||
RID_PUBLIC,
|
||||
RID_PRIVATE,
|
||||
|
|
|
@ -153,6 +153,7 @@ do_inline_function_hair (type, friend_list)
|
|||
|
||||
/* Report an argument type mismatch between the best declared function
|
||||
we could find and the current argument list that we have. */
|
||||
|
||||
void
|
||||
report_type_mismatch (cp, parmtypes, name_kind)
|
||||
struct candidate *cp;
|
||||
|
@ -261,6 +262,7 @@ static int nofold;
|
|||
} while (0)
|
||||
|
||||
/* Code to concatenate an asciified integer to a string. */
|
||||
|
||||
static
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
|
@ -356,6 +358,7 @@ build_overload_nested_name (decl)
|
|||
}
|
||||
|
||||
/* Encoding for an INTEGER_CST value. */
|
||||
|
||||
static void
|
||||
build_overload_int (value)
|
||||
tree value;
|
||||
|
@ -974,6 +977,7 @@ build_static_name (basetype, name)
|
|||
FOR_METHOD is 1 if this overload is being performed
|
||||
for a method, rather than a function type. It is 2 if
|
||||
this overload is being performed for a constructor. */
|
||||
|
||||
tree
|
||||
build_decl_overload (dname, parms, for_method)
|
||||
tree dname;
|
||||
|
@ -1058,6 +1062,7 @@ build_decl_overload (dname, parms, for_method)
|
|||
}
|
||||
|
||||
/* Build an overload name for the type expression TYPE. */
|
||||
|
||||
tree
|
||||
build_typename_overload (type)
|
||||
tree type;
|
||||
|
@ -1139,6 +1144,7 @@ declare_overloaded (name)
|
|||
/* Check to see if NAME is overloaded. For first approximation,
|
||||
check to see if its TREE_OVERLOADED is set. This is used on
|
||||
IDENTIFIER nodes. */
|
||||
|
||||
int
|
||||
is_overloaded (name)
|
||||
tree name;
|
||||
|
@ -1949,6 +1955,7 @@ emit_thunk (thunk_fndecl)
|
|||
|
||||
/* For the anonymous union in TYPE, return the member that is at least as
|
||||
large as the rest of the members, so we can copy it. */
|
||||
|
||||
static tree
|
||||
largest_union_member (type)
|
||||
tree type;
|
||||
|
@ -1965,6 +1972,7 @@ largest_union_member (type)
|
|||
}
|
||||
|
||||
/* Generate code for default X(X&) constructor. */
|
||||
|
||||
void
|
||||
do_build_copy_constructor (fndecl)
|
||||
tree fndecl;
|
||||
|
|
58
gcc/cp/pt.c
58
gcc/cp/pt.c
|
@ -21,12 +21,12 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
|
|||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Known bugs or deficiencies include:
|
||||
* templates for class static data don't work (methods only)
|
||||
* duplicated method templates can crash the compiler
|
||||
* interface/impl data is taken from file defining the template
|
||||
* all methods must be provided in header files; can't use a source
|
||||
file that contains only the method templates and "just win"
|
||||
*/
|
||||
|
||||
templates for class static data don't work (methods only),
|
||||
duplicated method templates can crash the compiler,
|
||||
interface/impl data is taken from file defining the template,
|
||||
all methods must be provided in header files; can't use a source
|
||||
file that contains only the method templates and "just win". */
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
|
@ -78,6 +78,7 @@ begin_template_parm_list ()
|
|||
|
||||
/* Process information from new template parameter NEXT and append it to the
|
||||
LIST being built. */
|
||||
|
||||
tree
|
||||
process_template_parm (list, next)
|
||||
tree list, next;
|
||||
|
@ -274,6 +275,7 @@ tree tsubst PROTO ((tree, tree*, int, tree));
|
|||
/* Convert all template arguments to their appropriate types, and return
|
||||
a vector containing the resulting values. If any error occurs, return
|
||||
error_mark_node. */
|
||||
|
||||
static tree
|
||||
coerce_template_parms (parms, arglist, in_decl)
|
||||
tree parms, arglist;
|
||||
|
@ -477,6 +479,7 @@ comp_template_args (oldargs, newargs)
|
|||
|
||||
/* Given class template name and parameter list, produce a user-friendly name
|
||||
for the instantiation. */
|
||||
|
||||
static char *
|
||||
mangle_class_name_for_template (name, parms, arglist)
|
||||
char *name;
|
||||
|
@ -583,13 +586,20 @@ static void
|
|||
add_pending_template (d)
|
||||
tree d;
|
||||
{
|
||||
if (TREE_LANG_FLAG_0 (DECL_TEMPLATE_INFO (d)))
|
||||
tree ti;
|
||||
|
||||
if (TREE_CODE_CLASS (TREE_CODE (d)) == 't')
|
||||
ti = CLASSTYPE_TEMPLATE_INFO (d);
|
||||
else
|
||||
ti = DECL_TEMPLATE_INFO (d);
|
||||
|
||||
if (TREE_LANG_FLAG_0 (ti))
|
||||
return;
|
||||
|
||||
*template_tail = perm_tree_cons
|
||||
(current_function_decl, d, NULL_TREE);
|
||||
template_tail = &TREE_CHAIN (*template_tail);
|
||||
TREE_LANG_FLAG_0 (DECL_TEMPLATE_INFO (d)) = 1;
|
||||
TREE_LANG_FLAG_0 (ti) = 1;
|
||||
}
|
||||
|
||||
/* Given an IDENTIFIER_NODE (type TEMPLATE_DECL) and a chain of
|
||||
|
@ -601,6 +611,7 @@ add_pending_template (d)
|
|||
|
||||
IN_DECL, if non-NULL, is the template declaration we are trying to
|
||||
instantiate. */
|
||||
|
||||
tree
|
||||
lookup_template_class (d1, arglist, in_decl)
|
||||
tree d1, arglist;
|
||||
|
@ -732,14 +743,7 @@ lookup_template_class (d1, arglist, in_decl)
|
|||
if (flag_external_templates && ! uses_template_parms (arglist)
|
||||
&& CLASSTYPE_INTERFACE_KNOWN (TREE_TYPE (template))
|
||||
&& ! CLASSTYPE_INTERFACE_ONLY (TREE_TYPE (template)))
|
||||
{
|
||||
tree d;
|
||||
|
||||
instantiate_class_template (t);
|
||||
|
||||
for (d = TYPE_METHODS (t); d; d = TREE_CHAIN (d))
|
||||
add_pending_template (d);
|
||||
}
|
||||
add_pending_template (t);
|
||||
}
|
||||
|
||||
return t;
|
||||
|
@ -1188,6 +1192,8 @@ instantiate_class_template (type)
|
|||
/* XXX handle attributes */
|
||||
type = finish_struct_1 (type, NULL_TREE, 0);
|
||||
CLASSTYPE_GOT_SEMICOLON (type) = 1;
|
||||
|
||||
repo_template_used (type);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1484,6 +1490,12 @@ tsubst (t, args, nargs, in_decl)
|
|||
tree_cons (argvec, r, DECL_TEMPLATE_INSTANTIATIONS (tmpl));
|
||||
}
|
||||
|
||||
/* Like grokfndecl. If we don't do this, pushdecl will mess up our
|
||||
TREE_CHAIN because it doesn't find a previous decl. Sigh. */
|
||||
if (member
|
||||
&& IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (r)) == NULL_TREE)
|
||||
IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (r)) = r;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -1876,6 +1888,9 @@ tsubst_copy (t, args, nargs, in_decl)
|
|||
|
||||
case CAST_EXPR:
|
||||
case REINTERPRET_CAST_EXPR:
|
||||
case CONST_CAST_EXPR:
|
||||
case STATIC_CAST_EXPR:
|
||||
case DYNAMIC_CAST_EXPR:
|
||||
return build1
|
||||
(code, tsubst (TREE_TYPE (t), args, nargs, in_decl),
|
||||
tsubst_copy (TREE_OPERAND (t, 0), args, nargs, in_decl));
|
||||
|
@ -2038,6 +2053,13 @@ tsubst_copy (t, args, nargs, in_decl)
|
|||
case TYPENAME_TYPE:
|
||||
return tsubst (t, args, nargs, in_decl);
|
||||
|
||||
case IDENTIFIER_NODE:
|
||||
if (IDENTIFIER_TYPENAME_P (t))
|
||||
return build_typename_overload
|
||||
(tsubst (TREE_TYPE (t), args, nargs, in_decl));
|
||||
else
|
||||
return t;
|
||||
|
||||
default:
|
||||
return t;
|
||||
}
|
||||
|
@ -2497,6 +2519,7 @@ type_unification (tparms, targs, parms, args, nsubsts, subr)
|
|||
}
|
||||
|
||||
/* Tail recursion is your friend. */
|
||||
|
||||
static int
|
||||
unify (tparms, targs, ntparms, parm, arg, nsubsts)
|
||||
tree tparms, *targs, parm, arg;
|
||||
|
@ -2726,6 +2749,7 @@ mark_decl_instantiated (result, extern_p)
|
|||
}
|
||||
|
||||
/* called from the parser. */
|
||||
|
||||
void
|
||||
do_function_instantiation (declspecs, declarator, storage)
|
||||
tree declspecs, declarator, storage;
|
||||
|
@ -2948,7 +2972,7 @@ instantiate_decl (d)
|
|||
warn_if_unknown_interface (pattern);
|
||||
}
|
||||
|
||||
if (at_eof && ! DECL_INLINE (d))
|
||||
if (at_eof)
|
||||
import_export_decl (d);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ init_rtti_processing ()
|
|||
pointer somewhere, return a pointer to a possible sub-object that
|
||||
has a virtual table pointer in it that is the vtable parent for
|
||||
that sub-object. */
|
||||
|
||||
static tree
|
||||
build_headof_sub (exp)
|
||||
tree exp;
|
||||
|
@ -71,6 +72,7 @@ build_headof_sub (exp)
|
|||
object pointed to by EXP with type cv void*, if the class has any
|
||||
virtual functions (TYPE_VIRTUAL_P), else just return the
|
||||
expression. */
|
||||
|
||||
static tree
|
||||
build_headof (exp)
|
||||
tree exp;
|
||||
|
@ -112,6 +114,7 @@ build_headof (exp)
|
|||
/* Return the type_info node associated with the expression EXP. If EXP is
|
||||
a reference to a polymorphic class, return the dynamic type; otherwise
|
||||
return the static type of the expression. */
|
||||
|
||||
tree
|
||||
build_typeid (exp)
|
||||
tree exp;
|
||||
|
@ -269,6 +272,7 @@ get_typeid_1 (type)
|
|||
}
|
||||
|
||||
/* Return the type_info object for TYPE, creating it if necessary. */
|
||||
|
||||
tree
|
||||
get_typeid (type)
|
||||
tree type;
|
||||
|
@ -325,7 +329,8 @@ throw_bad_cast ()
|
|||
/* Check whether TEST is null before returning RESULT. If TEST is used in
|
||||
RESULT, it must have previously had a save_expr applied to it. */
|
||||
|
||||
tree ifnonnull (test, result)
|
||||
tree
|
||||
ifnonnull (test, result)
|
||||
tree test, result;
|
||||
{
|
||||
return build (COND_EXPR, TREE_TYPE (result),
|
||||
|
@ -349,6 +354,12 @@ build_dynamic_cast (type, expr)
|
|||
if (type == error_mark_node || expr == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
if (current_template_parms)
|
||||
{
|
||||
tree t = build_min (DYNAMIC_CAST_EXPR, type, expr);
|
||||
return t;
|
||||
}
|
||||
|
||||
switch (tc)
|
||||
{
|
||||
case POINTER_TYPE:
|
||||
|
@ -797,6 +808,7 @@ expand_class_desc (tdecl, type)
|
|||
}
|
||||
|
||||
/* Build an initializer for a __pointer_type_info node. */
|
||||
|
||||
static void
|
||||
expand_ptr_desc (tdecl, type)
|
||||
tree tdecl;
|
||||
|
@ -1029,6 +1041,7 @@ synthesize_tinfo_fn (fndecl)
|
|||
(as opposed to merely referencing it). 1 means treat according to
|
||||
#pragma interface/#pragma implementation rules. 2 means define as
|
||||
global and public, no matter what. */
|
||||
|
||||
tree
|
||||
build_t_desc (type, definition)
|
||||
tree type;
|
||||
|
@ -1192,6 +1205,7 @@ build_t_desc (type, definition)
|
|||
}
|
||||
|
||||
/* Build an initializer for a __i_desc node. */
|
||||
|
||||
tree
|
||||
build_i_desc (decl)
|
||||
tree decl;
|
||||
|
@ -1225,6 +1239,7 @@ build_i_desc (decl)
|
|||
}
|
||||
|
||||
/* Build an initializer for a __m_desc node. */
|
||||
|
||||
tree
|
||||
build_m_desc (decl)
|
||||
tree decl;
|
||||
|
|
115
gcc/cp/search.c
115
gcc/cp/search.c
|
@ -40,9 +40,11 @@ extern tree abort_fndecl;
|
|||
#include "stack.h"
|
||||
|
||||
/* Obstack used for remembering decision points of breadth-first. */
|
||||
|
||||
static struct obstack search_obstack;
|
||||
|
||||
/* Methods for pushing and popping objects to and from obstacks. */
|
||||
|
||||
struct stack_level *
|
||||
push_stack_level (obstack, tp, size)
|
||||
struct obstack *obstack;
|
||||
|
@ -85,6 +87,7 @@ static tree vbase_decl_ptr_intermediate, vbase_decl_ptr;
|
|||
static tree vbase_init_result;
|
||||
|
||||
/* Allocate a level of searching. */
|
||||
|
||||
static struct search_level *
|
||||
push_search_level (stack, obstack)
|
||||
struct stack_level *stack;
|
||||
|
@ -97,6 +100,7 @@ push_search_level (stack, obstack)
|
|||
}
|
||||
|
||||
/* Discard a level of search allocation. */
|
||||
|
||||
static struct search_level *
|
||||
pop_search_level (obstack)
|
||||
struct stack_level *obstack;
|
||||
|
@ -107,6 +111,7 @@ pop_search_level (obstack)
|
|||
}
|
||||
|
||||
/* Search memoization. */
|
||||
|
||||
struct type_level
|
||||
{
|
||||
struct stack_level base;
|
||||
|
@ -157,6 +162,7 @@ static struct type_level *prev_type_stack;
|
|||
static tree closed_envelopes = NULL_TREE;
|
||||
|
||||
/* Allocate a level of type memoization context. */
|
||||
|
||||
static struct type_level *
|
||||
push_type_level (stack, obstack)
|
||||
struct stack_level *stack;
|
||||
|
@ -186,6 +192,7 @@ pop_type_level (stack)
|
|||
|
||||
/* Make something that looks like a TREE_LIST, but
|
||||
do it on the type_obstack_entries obstack. */
|
||||
|
||||
static tree
|
||||
my_tree_cons (purpose, value, chain)
|
||||
tree purpose, value, chain;
|
||||
|
@ -217,6 +224,7 @@ my_build_string (str)
|
|||
|
||||
/* Memoizing machinery to make searches for multiple inheritance
|
||||
reasonably efficient. */
|
||||
|
||||
#define MEMOIZE_HASHSIZE 8
|
||||
typedef struct memoized_entry
|
||||
{
|
||||
|
@ -247,6 +255,7 @@ my_new_memoized_entry (chain)
|
|||
}
|
||||
|
||||
/* Clears the deferred pop from pop_memoized_context, if any. */
|
||||
|
||||
static void
|
||||
clear_memoized_cache ()
|
||||
{
|
||||
|
@ -266,7 +275,7 @@ make_memoized_table_entry (type, name, function_p)
|
|||
tree type, name;
|
||||
int function_p;
|
||||
{
|
||||
int index = MEMOIZED_HASH_FN (name);
|
||||
int idx = MEMOIZED_HASH_FN (name);
|
||||
tree entry, *prev_entry;
|
||||
|
||||
/* Since we allocate from the type_obstack, we must pop any deferred
|
||||
|
@ -284,9 +293,9 @@ make_memoized_table_entry (type, name, function_p)
|
|||
my_friendly_abort (88);
|
||||
}
|
||||
if (function_p)
|
||||
prev_entry = &MEMOIZED_FNFIELDS (CLASSTYPE_MTABLE_ENTRY (type), index);
|
||||
prev_entry = &MEMOIZED_FNFIELDS (CLASSTYPE_MTABLE_ENTRY (type), idx);
|
||||
else
|
||||
prev_entry = &MEMOIZED_FIELDS (CLASSTYPE_MTABLE_ENTRY (type), index);
|
||||
prev_entry = &MEMOIZED_FIELDS (CLASSTYPE_MTABLE_ENTRY (type), idx);
|
||||
|
||||
entry = my_tree_cons (name, NULL_TREE, *prev_entry);
|
||||
*prev_entry = entry;
|
||||
|
@ -325,6 +334,7 @@ make_memoized_table_entry (type, name, function_p)
|
|||
be NULL_TREE if we are not in a class's scope.
|
||||
|
||||
USE_OLD, if nonzero tries to use previous context. */
|
||||
|
||||
void
|
||||
push_memoized_context (type, use_old)
|
||||
tree type;
|
||||
|
@ -363,6 +373,7 @@ push_memoized_context (type, use_old)
|
|||
If we wanted to, we could not use pop_search_level, since
|
||||
poping that level allows the data we have collected to
|
||||
be clobbered; a stack of obstacks would be needed. */
|
||||
|
||||
void
|
||||
pop_memoized_context (use_old)
|
||||
int use_old;
|
||||
|
@ -402,6 +413,7 @@ pop_memoized_context (use_old)
|
|||
the same type as the type given in PARENT. To be optimal, we want
|
||||
the first one that is found by going through the least number of
|
||||
virtual bases. DEPTH should be NULL_PTR. */
|
||||
|
||||
static tree
|
||||
get_vbase (parent, binfo, depth)
|
||||
tree parent, binfo;
|
||||
|
@ -448,6 +460,7 @@ get_vbase (parent, binfo, depth)
|
|||
/* Convert EXPR to a virtual base class of type TYPE. We know that
|
||||
EXPR is a non-null POINTER_TYPE to RECORD_TYPE. We also know that
|
||||
the type of what expr points to has a virtual base of type TYPE. */
|
||||
|
||||
tree
|
||||
convert_pointer_to_vbase (type, expr)
|
||||
tree type;
|
||||
|
@ -508,6 +521,7 @@ get_binfo (parent, binfo, protect)
|
|||
}
|
||||
|
||||
/* This is the newer depth first get_base_distance routine. */
|
||||
|
||||
static int
|
||||
get_base_distance_recursive (binfo, depth, is_private, rval,
|
||||
rval_private_ptr, new_binfo_ptr, parent, path_ptr,
|
||||
|
@ -658,7 +672,7 @@ get_base_distance (parent, binfo, protect, path_ptr)
|
|||
type = BINFO_TYPE (binfo);
|
||||
else if (IS_AGGR_TYPE_CODE (TREE_CODE (binfo)))
|
||||
{
|
||||
type = binfo;
|
||||
type = complete_type (binfo);
|
||||
binfo = TYPE_BINFO (type);
|
||||
|
||||
if (path_ptr)
|
||||
|
@ -716,6 +730,7 @@ get_base_distance (parent, binfo, protect, path_ptr)
|
|||
/* Do a 1-level search for NAME as a member of TYPE. The caller must
|
||||
figure out whether it can access this field. (Since it is only one
|
||||
level, this is reasonable.) */
|
||||
|
||||
static tree
|
||||
lookup_field_1 (type, name)
|
||||
tree type, name;
|
||||
|
@ -759,11 +774,11 @@ lookup_field_1 (type, name)
|
|||
|
||||
/* There are a number of cases we need to be aware of here:
|
||||
current_class_type current_function_decl
|
||||
* global NULL NULL
|
||||
* fn-local NULL SET
|
||||
* class-local SET NULL
|
||||
* class->fn SET SET
|
||||
* fn->class SET SET
|
||||
global NULL NULL
|
||||
fn-local NULL SET
|
||||
class-local SET NULL
|
||||
class->fn SET SET
|
||||
fn->class SET SET
|
||||
|
||||
Those last two make life interesting. If we're in a function which is
|
||||
itself inside a class, we need decls to go into the fn's decls (our
|
||||
|
@ -998,6 +1013,7 @@ compute_access (basetype_path, field)
|
|||
found as a base class and sub-object of the object denoted by
|
||||
BINFO. This routine relies upon binfos not being shared, except
|
||||
for binfos for virtual bases. */
|
||||
|
||||
static int
|
||||
is_subobject_of_p (parent, binfo)
|
||||
tree parent, binfo;
|
||||
|
@ -1025,6 +1041,7 @@ is_subobject_of_p (parent, binfo)
|
|||
binfos given are the binfos corresponding to the particular places
|
||||
the FIELD_DECLs are found. This routine relies upon binfos not
|
||||
being shared, except for virtual bases. */
|
||||
|
||||
static int
|
||||
hides (hider_binfo, hidee_binfo)
|
||||
tree hider_binfo, hidee_binfo;
|
||||
|
@ -1041,22 +1058,23 @@ hides (hider_binfo, hidee_binfo)
|
|||
/* Very similar to lookup_fnfields_1 but it ensures that at least one
|
||||
function was declared inside the class given by TYPE. It really should
|
||||
only return functions that match the given TYPE. */
|
||||
|
||||
static int
|
||||
lookup_fnfields_here (type, name)
|
||||
tree type, name;
|
||||
{
|
||||
int index = lookup_fnfields_1 (type, name);
|
||||
int idx = lookup_fnfields_1 (type, name);
|
||||
tree fndecls;
|
||||
|
||||
/* ctors and dtors are always only in the right class. */
|
||||
if (index <= 1)
|
||||
return index;
|
||||
fndecls = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), index);
|
||||
if (idx <= 1)
|
||||
return idx;
|
||||
fndecls = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx);
|
||||
while (fndecls)
|
||||
{
|
||||
if (TYPE_MAIN_VARIANT (DECL_CLASS_CONTEXT (fndecls))
|
||||
== TYPE_MAIN_VARIANT (type))
|
||||
return index;
|
||||
return idx;
|
||||
fndecls = TREE_CHAIN (fndecls);
|
||||
}
|
||||
return -1;
|
||||
|
@ -1070,6 +1088,7 @@ lookup_fnfields_here (type, name)
|
|||
It was not clear what should happen if WANT_TYPE is set, and an
|
||||
ambiguity is found. At least one use (lookup_name) to not see
|
||||
the error. */
|
||||
|
||||
tree
|
||||
lookup_field (xbasetype, name, protect, want_type)
|
||||
register tree xbasetype, name;
|
||||
|
@ -1101,7 +1120,7 @@ lookup_field (xbasetype, name, protect, want_type)
|
|||
|
||||
/* Set this to nonzero if we don't know how to compute
|
||||
accurate error messages for access control. */
|
||||
int index = MEMOIZED_HASH_FN (name);
|
||||
int idx = MEMOIZED_HASH_FN (name);
|
||||
|
||||
#if 0
|
||||
/* We cannot search for constructor/destructor names like this. */
|
||||
|
@ -1128,7 +1147,7 @@ lookup_field (xbasetype, name, protect, want_type)
|
|||
|
||||
if (CLASSTYPE_MTABLE_ENTRY (type))
|
||||
{
|
||||
tree tem = MEMOIZED_FIELDS (CLASSTYPE_MTABLE_ENTRY (type), index);
|
||||
tree tem = MEMOIZED_FIELDS (CLASSTYPE_MTABLE_ENTRY (type), idx);
|
||||
|
||||
while (tem && TREE_PURPOSE (tem) != name)
|
||||
{
|
||||
|
@ -1453,6 +1472,7 @@ lookup_field (xbasetype, name, protect, want_type)
|
|||
}
|
||||
|
||||
/* Try to find NAME inside a nested class. */
|
||||
|
||||
tree
|
||||
lookup_nested_field (name, complain)
|
||||
tree name;
|
||||
|
@ -1517,6 +1537,7 @@ lookup_nested_field (name, complain)
|
|||
|
||||
/* TYPE is a class type. Return the index of the fields within
|
||||
the method vector with name NAME, or -1 is no such field exists. */
|
||||
|
||||
static int
|
||||
lookup_fnfields_1 (type, name)
|
||||
tree type, name;
|
||||
|
@ -1573,6 +1594,7 @@ lookup_fnfields_1 (type, name)
|
|||
As a special case, is COMPLAIN is -1, we don't complain, and we
|
||||
don't return error_mark_node, but rather the complete list of
|
||||
virtuals. This is used by get_virtuals_named_this. */
|
||||
|
||||
tree
|
||||
lookup_fnfields (basetype_path, name, complain)
|
||||
tree basetype_path, name;
|
||||
|
@ -1604,7 +1626,7 @@ lookup_fnfields (basetype_path, name, complain)
|
|||
|
||||
/* Set this to nonzero if we don't know how to compute
|
||||
accurate error messages for access control. */
|
||||
int index = MEMOIZED_HASH_FN (name);
|
||||
int idx = MEMOIZED_HASH_FN (name);
|
||||
|
||||
if (complain == -1)
|
||||
{
|
||||
|
@ -1628,7 +1650,7 @@ lookup_fnfields (basetype_path, name, complain)
|
|||
/* The memoization code is in need of maintenance. */
|
||||
if (!find_all && CLASSTYPE_MTABLE_ENTRY (type))
|
||||
{
|
||||
tree tem = MEMOIZED_FNFIELDS (CLASSTYPE_MTABLE_ENTRY (type), index);
|
||||
tree tem = MEMOIZED_FNFIELDS (CLASSTYPE_MTABLE_ENTRY (type), idx);
|
||||
|
||||
while (tem && TREE_PURPOSE (tem) != name)
|
||||
{
|
||||
|
@ -1685,19 +1707,19 @@ lookup_fnfields (basetype_path, name, complain)
|
|||
else
|
||||
entry = 0;
|
||||
|
||||
index = lookup_fnfields_here (type, name);
|
||||
if (index >= 0 || lookup_field_1 (type, name))
|
||||
idx = lookup_fnfields_here (type, name);
|
||||
if (idx >= 0 || lookup_field_1 (type, name))
|
||||
{
|
||||
rval_binfo = basetype_path;
|
||||
rval_binfo_h = rval_binfo;
|
||||
}
|
||||
|
||||
if (index >= 0)
|
||||
if (idx >= 0)
|
||||
{
|
||||
rval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), index);
|
||||
rval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx);
|
||||
rvals = my_tree_cons (basetype_path, rval, rvals);
|
||||
if (BINFO_BASETYPES (binfo) && CLASSTYPE_BASELINK_VEC (type))
|
||||
TREE_TYPE (rvals) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), index);
|
||||
TREE_TYPE (rvals) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), idx);
|
||||
|
||||
if (entry)
|
||||
{
|
||||
|
@ -1744,7 +1766,7 @@ lookup_fnfields (basetype_path, name, complain)
|
|||
{
|
||||
tree binfos = BINFO_BASETYPES (binfo);
|
||||
int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
|
||||
int index;
|
||||
int idx;
|
||||
|
||||
/* Process and/or queue base types. */
|
||||
for (i = 0; i < n_baselinks; i++)
|
||||
|
@ -1794,9 +1816,9 @@ lookup_fnfields (basetype_path, name, complain)
|
|||
and we do find NAME in TYPE, verify that such a second
|
||||
sighting is in fact valid. */
|
||||
|
||||
index = lookup_fnfields_here (type, name);
|
||||
idx = lookup_fnfields_here (type, name);
|
||||
|
||||
if (index >= 0 || (lookup_field_1 (type, name)!=NULL_TREE && !find_all))
|
||||
if (idx >= 0 || (lookup_field_1 (type, name)!=NULL_TREE && !find_all))
|
||||
{
|
||||
if (rval_binfo && !find_all && hides (rval_binfo_h, binfo_h))
|
||||
{
|
||||
|
@ -1807,15 +1829,15 @@ lookup_fnfields (basetype_path, name, complain)
|
|||
{
|
||||
/* This is ok, the member found is here (binfo), not in
|
||||
rval_binfo. */
|
||||
if (index >= 0)
|
||||
if (idx >= 0)
|
||||
{
|
||||
rval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), index);
|
||||
rval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx);
|
||||
/* Note, rvals can only be previously set if find_all is
|
||||
true. */
|
||||
rvals = my_tree_cons (basetype_path, rval, rvals);
|
||||
if (TYPE_BINFO_BASETYPES (type)
|
||||
&& CLASSTYPE_BASELINK_VEC (type))
|
||||
TREE_TYPE (rvals) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), index);
|
||||
TREE_TYPE (rvals) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), idx);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2006,6 +2028,7 @@ tree_has_any_destructor_p (binfo, i)
|
|||
|
||||
DTORP is nonzero if we are looking for a destructor. Destructors
|
||||
need special treatment because they do not match by name. */
|
||||
|
||||
tree
|
||||
get_matching_virtual (binfo, fndecl, dtorp)
|
||||
tree binfo, fndecl;
|
||||
|
@ -2134,6 +2157,7 @@ get_matching_virtual (binfo, fndecl, dtorp)
|
|||
/* Return the list of virtual functions which are abstract in type
|
||||
TYPE that come from non virtual base classes. See
|
||||
expand_direct_vtbls_init for the style of search we do. */
|
||||
|
||||
static tree
|
||||
get_abstract_virtuals_1 (binfo, do_self, abstract_virtuals)
|
||||
tree binfo;
|
||||
|
@ -2175,6 +2199,7 @@ get_abstract_virtuals_1 (binfo, do_self, abstract_virtuals)
|
|||
/* Return the list of virtual functions which are abstract in type TYPE.
|
||||
This information is cached, and so must be built on a
|
||||
non-temporary obstack. */
|
||||
|
||||
tree
|
||||
get_abstract_virtuals (type)
|
||||
tree type;
|
||||
|
@ -2217,7 +2242,7 @@ get_baselinks (type_as_binfo_list, type, name)
|
|||
tree type_as_binfo_list;
|
||||
tree type, name;
|
||||
{
|
||||
int head = 0, tail = 0, index;
|
||||
int head = 0, tail = 0, idx;
|
||||
tree rval = 0, nval = 0;
|
||||
tree basetypes = type_as_binfo_list;
|
||||
tree binfo = TYPE_BINFO (type);
|
||||
|
@ -2253,17 +2278,17 @@ get_baselinks (type_as_binfo_list, type, name)
|
|||
basetypes = search_stack->first[head++];
|
||||
binfo = TREE_VALUE (basetypes);
|
||||
type = BINFO_TYPE (binfo);
|
||||
index = lookup_fnfields_1 (type, name);
|
||||
if (index >= 0)
|
||||
idx = lookup_fnfields_1 (type, name);
|
||||
if (idx >= 0)
|
||||
{
|
||||
nval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), index);
|
||||
nval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx);
|
||||
rval = hash_tree_cons (0, 0, 0, basetypes, nval, rval);
|
||||
if (TYPE_BINFO_BASETYPES (type) == 0)
|
||||
goto dont_queue;
|
||||
else if (TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type)) == 1)
|
||||
{
|
||||
if (CLASSTYPE_BASELINK_VEC (type))
|
||||
TREE_TYPE (rval) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), index);
|
||||
TREE_TYPE (rval) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), idx);
|
||||
goto dont_queue;
|
||||
}
|
||||
}
|
||||
|
@ -2322,6 +2347,7 @@ static int mi_size;
|
|||
base class. The normal convert_pointer_to routine would diagnose
|
||||
the conversion as ambiguous, under MI code that has the base class
|
||||
as an ambiguous base class. */
|
||||
|
||||
static tree
|
||||
convert_pointer_to_single_level (to_type, expr)
|
||||
tree to_type, expr;
|
||||
|
@ -2341,6 +2367,7 @@ convert_pointer_to_single_level (to_type, expr)
|
|||
This routine has to remember the path it walked up, when
|
||||
dfs_init_vbase_pointers is the work function, as otherwise there
|
||||
would be no record. */
|
||||
|
||||
static void
|
||||
dfs_walk (binfo, fn, qfn)
|
||||
tree binfo;
|
||||
|
@ -2554,6 +2581,7 @@ dfs_debug_mark (binfo)
|
|||
virtual base class, given the global pointer vbase_decl_ptr.
|
||||
|
||||
We use the global vbase_types. ICK! */
|
||||
|
||||
static void
|
||||
dfs_find_vbases (binfo)
|
||||
tree binfo;
|
||||
|
@ -2624,6 +2652,7 @@ dfs_init_vbase_pointers (binfo)
|
|||
/* Sometimes this needs to clear both VTABLE_PATH and NEW_VTABLE. Other
|
||||
times, just NEW_VTABLE, but optimizer should make both with equal
|
||||
efficiency (though it does not currently). */
|
||||
|
||||
static void
|
||||
dfs_clear_vbase_slots (binfo)
|
||||
tree binfo;
|
||||
|
@ -2666,6 +2695,7 @@ init_vbase_pointers (type, decl_ptr)
|
|||
We know that if there is more than one place (binfo) the fndecl that the
|
||||
declared, they all refer to the same binfo. See get_class_offset_1 for
|
||||
the check that ensures this. */
|
||||
|
||||
static tree
|
||||
virtual_context (fndecl, t, vbase)
|
||||
tree fndecl, t, vbase;
|
||||
|
@ -2718,6 +2748,7 @@ virtual_context (fndecl, t, vbase)
|
|||
calculated once. The offsets are computed by where we think the
|
||||
vbase should be (as noted by the CLASSTYPE_SEARCH_SLOT) minus where
|
||||
the vbase really is. */
|
||||
|
||||
static void
|
||||
expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
|
||||
vbase_offsets)
|
||||
|
@ -2826,6 +2857,7 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
|
|||
|
||||
/* Fixup upcast offsets for all direct vtables. Patterned after
|
||||
expand_direct_vtbls_init. */
|
||||
|
||||
static void
|
||||
fixup_virtual_upcast_offsets (real_binfo, binfo, init_self, can_elide, addr, orig_addr, type, vbase, vbase_offsets)
|
||||
tree real_binfo, binfo;
|
||||
|
@ -2906,10 +2938,11 @@ expand_indirect_vtbls_init (binfo, true_exp, decl_ptr)
|
|||
expand_direct_vtbls_init (vbases, TYPE_BINFO (BINFO_TYPE (vbases)),
|
||||
1, 0, addr);
|
||||
|
||||
/* Now we adjust the offsets for virtual functions that cross
|
||||
virtual boundaries on an implicit upcast on vf call so that
|
||||
the layout of the most complete type is used, instead of
|
||||
assuming the layout of the virtual bases from our current type. */
|
||||
/* Now we adjust the offsets for virtual functions that
|
||||
cross virtual boundaries on an implicit upcast on vf call
|
||||
so that the layout of the most complete type is used,
|
||||
instead of assuming the layout of the virtual bases from
|
||||
our current type. */
|
||||
|
||||
if (flag_vtable_thunks)
|
||||
{
|
||||
|
@ -2968,6 +3001,7 @@ dfs_get_vbase_types (binfo)
|
|||
}
|
||||
|
||||
/* get a list of virtual base classes in dfs order. */
|
||||
|
||||
tree
|
||||
get_vbase_types (type)
|
||||
tree type;
|
||||
|
@ -3097,6 +3131,7 @@ note_debug_info_needed (type)
|
|||
/* Subroutines of push_class_decls (). */
|
||||
|
||||
/* Add in a decl to the envelope. */
|
||||
|
||||
static void
|
||||
envelope_add_decl (type, decl, values)
|
||||
tree type, decl, *values;
|
||||
|
@ -3298,6 +3333,7 @@ dfs_pushdecls (binfo)
|
|||
}
|
||||
|
||||
/* Consolidate unique (by name) member functions. */
|
||||
|
||||
static void
|
||||
dfs_compress_decls (binfo)
|
||||
tree binfo;
|
||||
|
@ -3340,6 +3376,7 @@ dfs_compress_decls (binfo)
|
|||
with `error_mark_node' so that if they are encountered
|
||||
without explicit qualification, we can emit an error
|
||||
message. */
|
||||
|
||||
void
|
||||
push_class_decls (type)
|
||||
tree type;
|
||||
|
@ -3394,6 +3431,7 @@ push_class_decls (type)
|
|||
}
|
||||
|
||||
/* Here's a subroutine we need because C lacks lambdas. */
|
||||
|
||||
static void
|
||||
dfs_unuse_fields (binfo)
|
||||
tree binfo;
|
||||
|
@ -3517,6 +3555,7 @@ lookup_conversions (type)
|
|||
tree type;
|
||||
{
|
||||
conversions = NULL_TREE;
|
||||
if (TYPE_SIZE (type))
|
||||
dfs_walk (TYPE_BINFO (type), add_conversions, 0);
|
||||
return conversions;
|
||||
}
|
||||
|
|
22
gcc/cp/sig.c
22
gcc/cp/sig.c
|
@ -153,8 +153,7 @@ build_signature_pointer_or_reference_type (to_type, constp, volatilep, refp)
|
|||
const s * sptr;
|
||||
};
|
||||
|
||||
Similarly, for `volatile' and `const volatile'.
|
||||
*/
|
||||
Similarly, for `volatile' and `const volatile'. */
|
||||
|
||||
t = make_lang_type (RECORD_TYPE);
|
||||
{
|
||||
|
@ -423,6 +422,7 @@ match_method_types (sig_mtype, class_mtype)
|
|||
}
|
||||
|
||||
/* Undo casts of opaque type variables to the RHS types. */
|
||||
|
||||
static void
|
||||
undo_casts (sig_ty)
|
||||
tree sig_ty;
|
||||
|
@ -562,7 +562,7 @@ build_signature_table_constructor (sig_ty, rhs)
|
|||
}
|
||||
else
|
||||
{
|
||||
tree tag, vb_off, delta, index, pfn, vt_off;
|
||||
tree tag, vb_off, delta, idx, pfn, vt_off;
|
||||
tree tag_decl, vb_off_decl, delta_decl, index_decl;
|
||||
tree pfn_decl, vt_off_decl;
|
||||
|
||||
|
@ -572,7 +572,7 @@ build_signature_table_constructor (sig_ty, rhs)
|
|||
tag = build_unary_op (NEGATE_EXPR, integer_one_node, 0);
|
||||
vb_off = build_unary_op (NEGATE_EXPR, integer_one_node, 0);
|
||||
delta = integer_zero_node;
|
||||
index = integer_zero_node;
|
||||
idx = integer_zero_node;
|
||||
pfn = build_addr_func (rhs_method);
|
||||
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (rhs_method)) = 1;
|
||||
TREE_TYPE (pfn) = ptr_type_node;
|
||||
|
@ -590,7 +590,7 @@ build_signature_table_constructor (sig_ty, rhs)
|
|||
else
|
||||
delta = BINFO_OFFSET
|
||||
(get_binfo (DECL_CLASS_CONTEXT (rhs_method), rhstype, 1));
|
||||
index = DECL_VINDEX (rhs_method);
|
||||
idx = DECL_VINDEX (rhs_method);
|
||||
vt_off = get_vfield_offset (get_binfo (DECL_CONTEXT (rhs_method),
|
||||
rhstype, 0));
|
||||
}
|
||||
|
@ -601,7 +601,7 @@ build_signature_table_constructor (sig_ty, rhs)
|
|||
vb_off = build_unary_op (NEGATE_EXPR, integer_one_node, 0);
|
||||
delta = BINFO_OFFSET (get_binfo (DECL_CLASS_CONTEXT (rhs_method),
|
||||
rhstype, 1));
|
||||
index = integer_zero_node;
|
||||
idx = integer_zero_node;
|
||||
pfn = build_addr_func (rhs_method);
|
||||
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (rhs_method)) = 1;
|
||||
TREE_TYPE (pfn) = ptr_type_node;
|
||||
|
@ -621,7 +621,7 @@ build_signature_table_constructor (sig_ty, rhs)
|
|||
tag = convert (TREE_TYPE (tag_decl), tag);
|
||||
vb_off = convert (TREE_TYPE (vb_off_decl), vb_off);
|
||||
delta = convert (TREE_TYPE (delta_decl), delta);
|
||||
index = convert (TREE_TYPE (index_decl), index);
|
||||
idx = convert (TREE_TYPE (index_decl), idx);
|
||||
|
||||
if (DECL_VINDEX (rhs_method))
|
||||
{
|
||||
|
@ -636,7 +636,7 @@ build_signature_table_constructor (sig_ty, rhs)
|
|||
tbl_entry = build_tree_list (pfn_decl, pfn);
|
||||
}
|
||||
tbl_entry = tree_cons (delta_decl, delta,
|
||||
tree_cons (index_decl, index, tbl_entry));
|
||||
tree_cons (index_decl, idx, tbl_entry));
|
||||
tbl_entry = tree_cons (tag_decl, tag,
|
||||
tree_cons (vb_off_decl, vb_off, tbl_entry));
|
||||
tbl_entry = build (CONSTRUCTOR, sigtable_entry_type,
|
||||
|
@ -934,7 +934,7 @@ build_signature_method_call (basetype, instance, function, parms)
|
|||
tree tbl_entry = build_component_ref (build1 (INDIRECT_REF, basetype,
|
||||
signature_tbl_ptr),
|
||||
sig_field_name, basetype_path, 1);
|
||||
tree tag, delta, pfn, vt_off, index, vfn;
|
||||
tree tag, delta, pfn, vt_off, idx, vfn;
|
||||
tree deflt_call = NULL_TREE, direct_call, virtual_call, result;
|
||||
|
||||
tbl_entry = save_expr (tbl_entry);
|
||||
|
@ -942,7 +942,7 @@ build_signature_method_call (basetype, instance, function, parms)
|
|||
delta = build_component_ref (tbl_entry, delta_identifier, NULL_TREE, 1);
|
||||
pfn = build_component_ref (tbl_entry, pfn_identifier, NULL_TREE, 1);
|
||||
vt_off = build_component_ref (tbl_entry, vt_off_identifier, NULL_TREE, 1);
|
||||
index = build_component_ref (tbl_entry, index_identifier, NULL_TREE, 1);
|
||||
idx = build_component_ref (tbl_entry, index_identifier, NULL_TREE, 1);
|
||||
TREE_TYPE (pfn) = build_pointer_type (TREE_TYPE (function));
|
||||
|
||||
if (IS_DEFAULT_IMPLEMENTATION (function))
|
||||
|
@ -980,7 +980,7 @@ build_signature_method_call (basetype, instance, function, parms)
|
|||
convert (ptrdiff_type_node, vt_off));
|
||||
vtbl = build_indirect_ref (build_indirect_ref (vfld, NULL_PTR),
|
||||
NULL_PTR);
|
||||
aref = build_array_ref (vtbl, index);
|
||||
aref = build_array_ref (vtbl, idx);
|
||||
|
||||
if (flag_vtable_thunks)
|
||||
vfn = aref;
|
||||
|
|
|
@ -68,6 +68,7 @@ static int debug_yychar ();
|
|||
#endif
|
||||
|
||||
/* Initialize token_obstack. Called once, from init_lex. */
|
||||
|
||||
void
|
||||
init_spew ()
|
||||
{
|
||||
|
@ -78,6 +79,7 @@ init_spew ()
|
|||
/* Use functions for debugging... */
|
||||
|
||||
/* Return the number of tokens available on the fifo. */
|
||||
|
||||
static int
|
||||
num_tokens ()
|
||||
{
|
||||
|
@ -86,17 +88,19 @@ num_tokens ()
|
|||
}
|
||||
|
||||
/* Fetch the token N down the line from the head of the fifo. */
|
||||
|
||||
static struct token*
|
||||
nth_token (n)
|
||||
int n;
|
||||
{
|
||||
/* could just have this do slurp_ implicitly, but this way is easier
|
||||
* to debug... */
|
||||
to debug... */
|
||||
my_friendly_assert (n < num_tokens (), 298);
|
||||
return ((struct token*)obstack_base (&token_obstack)) + n + first_token;
|
||||
}
|
||||
|
||||
/* Add a token to the token fifo. */
|
||||
|
||||
static void
|
||||
add_token (t)
|
||||
struct token* t;
|
||||
|
@ -105,6 +109,7 @@ add_token (t)
|
|||
}
|
||||
|
||||
/* Consume the next token out of the fifo. */
|
||||
|
||||
static void
|
||||
consume_token ()
|
||||
{
|
||||
|
@ -262,8 +267,8 @@ yylex ()
|
|||
}
|
||||
|
||||
/* many tokens just need to be returned. At first glance, all we
|
||||
* have to do is send them back up, but some of them are needed to
|
||||
* figure out local context. */
|
||||
have to do is send them back up, but some of them are needed to
|
||||
figure out local context. */
|
||||
switch (tmp_token.yychar)
|
||||
{
|
||||
case EMPTY:
|
||||
|
@ -365,11 +370,11 @@ yylex ()
|
|||
}
|
||||
|
||||
/* token[0] == AGGR (struct/union/enum)
|
||||
* Thus, token[1] is either a TYPENAME or a TYPENAME_DEFN.
|
||||
* If token[2] == '{' or ':' then it's TYPENAME_DEFN.
|
||||
* It's also a definition if it's a forward declaration (as in 'struct Foo;')
|
||||
* which we can tell if token[2] == ';' *and* token[-1] != FRIEND or NEW.
|
||||
*/
|
||||
Thus, token[1] is either a TYPENAME or a TYPENAME_DEFN.
|
||||
If token[2] == '{' or ':' then it's TYPENAME_DEFN.
|
||||
It's also a definition if it's a forward declaration (as in 'struct Foo;')
|
||||
which we can tell if token[2] == ';' *and* token[-1] != FRIEND or NEW. */
|
||||
|
||||
static int
|
||||
do_aggr ()
|
||||
{
|
||||
|
@ -415,6 +420,7 @@ do_aggr ()
|
|||
|
||||
#ifdef SPEW_DEBUG
|
||||
/* debug_yychar takes a yychar (token number) value and prints its name. */
|
||||
|
||||
static int
|
||||
debug_yychar (yy)
|
||||
int yy;
|
||||
|
|
|
@ -206,6 +206,7 @@ lvalue_or_else (ref, string)
|
|||
Build an encapsulation of the initialization to perform
|
||||
and return it so that it can be processed by language-independent
|
||||
and language-specific expression expanders. */
|
||||
|
||||
tree
|
||||
build_cplus_new (type, init)
|
||||
tree type;
|
||||
|
@ -360,6 +361,7 @@ extern struct obstack *saveable_obstack;
|
|||
/* Construct, lay out and return the type of methods belonging to class
|
||||
BASETYPE and whose arguments are described by ARGTYPES and whose values
|
||||
are described by RETTYPE. If each type exists already, reuse it. */
|
||||
|
||||
tree
|
||||
build_cplus_method_type (basetype, rettype, argtypes)
|
||||
tree basetype, rettype, argtypes;
|
||||
|
@ -496,6 +498,7 @@ cp_build_type_variant (type, constp, volatilep)
|
|||
|
||||
Note that we don't have to worry about having two paths to the
|
||||
same base type, since this type owns its association list. */
|
||||
|
||||
void
|
||||
propagate_binfo_offsets (binfo, offset)
|
||||
tree binfo;
|
||||
|
@ -577,6 +580,7 @@ propagate_binfo_offsets (binfo, offset)
|
|||
|
||||
Returns the maximum number of virtual functions any of the virtual
|
||||
baseclasses provide. */
|
||||
|
||||
int
|
||||
layout_vbasetypes (rec, max)
|
||||
tree rec;
|
||||
|
@ -717,6 +721,7 @@ layout_vbasetypes (rec, max)
|
|||
creates a list of base_binfos in TYPE_BINFO (REC) from BINFOS.
|
||||
|
||||
Returns list of virtual base classes in a FIELD_DECL chain. */
|
||||
|
||||
tree
|
||||
layout_basetypes (rec, binfos)
|
||||
tree rec, binfos;
|
||||
|
@ -992,6 +997,7 @@ list_hash_add (hashcode, list)
|
|||
This function frees the list you pass in if it is a duplicate. */
|
||||
|
||||
/* Set to 1 to debug without canonicalization. Never set by program. */
|
||||
|
||||
static int debug_no_list_hash = 0;
|
||||
|
||||
tree
|
||||
|
@ -1038,6 +1044,7 @@ hash_tree_cons (via_public, via_virtual, via_protected, purpose, value, chain)
|
|||
}
|
||||
|
||||
/* Constructor for hashed lists. */
|
||||
|
||||
tree
|
||||
hash_tree_chain (value, chain)
|
||||
tree value, chain;
|
||||
|
@ -1055,6 +1062,7 @@ hash_tree_chain (value, chain)
|
|||
}
|
||||
|
||||
/* Similar, but used for concatenating two lists. */
|
||||
|
||||
tree
|
||||
hash_chainon (list1, list2)
|
||||
tree list1, list2;
|
||||
|
@ -1353,6 +1361,7 @@ is_aggr_type_2 (t1, t2)
|
|||
/* Give message using types TYPE1 and TYPE2 as arguments.
|
||||
PFN is the function which will print the message;
|
||||
S is the format string for PFN to use. */
|
||||
|
||||
void
|
||||
message_2_types (pfn, s, type1, type2)
|
||||
void (*pfn) ();
|
||||
|
@ -1421,6 +1430,7 @@ lang_printable_name (decl)
|
|||
|
||||
/* Build the FUNCTION_TYPE or METHOD_TYPE which may throw exceptions
|
||||
listed in RAISES. */
|
||||
|
||||
tree
|
||||
build_exception_variant (type, raises)
|
||||
tree type;
|
||||
|
@ -1653,6 +1663,7 @@ perm_manip (t)
|
|||
|
||||
/* Assuming T is a node built bottom-up, make it all exist on
|
||||
permanent obstack, if it is not permanent already. */
|
||||
|
||||
tree
|
||||
copy_to_permanent (t)
|
||||
tree t;
|
||||
|
@ -1701,6 +1712,7 @@ print_lang_statistics ()
|
|||
which `cc' doesn't know how to link. Note that the C++ front-end
|
||||
no longer actually uses the `assert' macro (instead, it calls
|
||||
my_friendly_assert). But all of the back-end files still need this. */
|
||||
|
||||
void
|
||||
__eprintf (string, expression, line, filename)
|
||||
#ifdef __STDC__
|
||||
|
@ -1720,8 +1732,9 @@ __eprintf (string, expression, line, filename)
|
|||
abort ();
|
||||
}
|
||||
|
||||
/* Return, as an INTEGER_CST node, the number of elements for
|
||||
TYPE (which is an ARRAY_TYPE). This counts only elements of the top array. */
|
||||
/* Return, as an INTEGER_CST node, the number of elements for TYPE
|
||||
(which is an ARRAY_TYPE). This counts only elements of the top
|
||||
array. */
|
||||
|
||||
tree
|
||||
array_type_nelts_top (type)
|
||||
|
@ -1732,8 +1745,8 @@ array_type_nelts_top (type)
|
|||
integer_one_node));
|
||||
}
|
||||
|
||||
/* Return, as an INTEGER_CST node, the number of elements for
|
||||
TYPE (which is an ARRAY_TYPE). This one is a recursive count of all
|
||||
/* Return, as an INTEGER_CST node, the number of elements for TYPE
|
||||
(which is an ARRAY_TYPE). This one is a recursive count of all
|
||||
ARRAY_TYPEs that are clumped together. */
|
||||
|
||||
tree
|
||||
|
@ -1765,6 +1778,7 @@ bot_manip (t)
|
|||
}
|
||||
|
||||
/* Actually, we'll just clean out the target exprs for the moment. */
|
||||
|
||||
tree
|
||||
break_out_target_exprs (t)
|
||||
tree t;
|
||||
|
@ -1918,7 +1932,7 @@ vec_binfo_member (elem, vec)
|
|||
|
||||
if (vec)
|
||||
for (i = 0; i < TREE_VEC_LENGTH (vec); ++i)
|
||||
if (elem == BINFO_TYPE (TREE_VEC_ELT (vec, i)))
|
||||
if (comptypes (elem, BINFO_TYPE (TREE_VEC_ELT (vec, i)), 1))
|
||||
return TREE_VEC_ELT (vec, i);
|
||||
|
||||
return NULL_TREE;
|
||||
|
|
104
gcc/cp/typeck.c
104
gcc/cp/typeck.c
|
@ -127,7 +127,7 @@ tree
|
|||
complete_type (type)
|
||||
tree type;
|
||||
{
|
||||
if (TYPE_SIZE (type) != NULL_TREE)
|
||||
if (type == error_mark_node || TYPE_SIZE (type) != NULL_TREE)
|
||||
;
|
||||
else if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type))
|
||||
{
|
||||
|
@ -142,6 +142,7 @@ complete_type (type)
|
|||
}
|
||||
|
||||
/* Return truthvalue of whether type of EXP is instantiated. */
|
||||
|
||||
int
|
||||
type_unknown_p (exp)
|
||||
tree exp;
|
||||
|
@ -153,6 +154,7 @@ type_unknown_p (exp)
|
|||
}
|
||||
|
||||
/* Return truthvalue of whether T is function (or pfn) type. */
|
||||
|
||||
int
|
||||
fntype_p (t)
|
||||
tree t;
|
||||
|
@ -166,6 +168,7 @@ fntype_p (t)
|
|||
/* Do `exp = require_instantiated_type (type, exp);' to make sure EXP
|
||||
does not have an uninstantiated type.
|
||||
TYPE is type to instantiate with, if uninstantiated. */
|
||||
|
||||
tree
|
||||
require_instantiated_type (type, exp, errval)
|
||||
tree type, exp, errval;
|
||||
|
@ -541,7 +544,8 @@ common_type (t1, t2)
|
|||
tree b1 = TYPE_OFFSET_BASETYPE (t1);
|
||||
tree b2 = TYPE_OFFSET_BASETYPE (t2);
|
||||
|
||||
if (DERIVED_FROM_P (b1, b2) && binfo_or_else (b1, b2))
|
||||
if (comptypes (b1, b2, 1)
|
||||
|| (DERIVED_FROM_P (b1, b2) && binfo_or_else (b1, b2)))
|
||||
return build_type_attribute_variant (t2, attributes);
|
||||
else if (binfo_or_else (b2, b1))
|
||||
return build_type_attribute_variant (t1, attributes);
|
||||
|
@ -554,6 +558,7 @@ common_type (t1, t2)
|
|||
}
|
||||
|
||||
/* Return 1 if TYPE1 and TYPE2 raise the same exceptions. */
|
||||
|
||||
int
|
||||
compexcepttypes (t1, t2)
|
||||
tree t1, t2;
|
||||
|
@ -616,6 +621,7 @@ comp_array_types (cmp, t1, t2, strict)
|
|||
pointer to a base classes. These allowances do not commute. In this
|
||||
case, TYPE1 is assumed to be the base class, and TYPE2 is assumed to
|
||||
be the derived class. */
|
||||
|
||||
int
|
||||
comptypes (type1, type2, strict)
|
||||
tree type1, type2;
|
||||
|
@ -931,6 +937,7 @@ comp_target_types (ttl, ttr, nptrs)
|
|||
/* If two types share a common base type, return that basetype.
|
||||
If there is not a unique most-derived base type, this function
|
||||
returns ERROR_MARK_NODE. */
|
||||
|
||||
tree
|
||||
common_base_type (tt1, tt2)
|
||||
tree tt1, tt2;
|
||||
|
@ -990,6 +997,7 @@ common_base_type (tt1, tt2)
|
|||
C++: See comment above about TYPE1, TYPE2, STRICT.
|
||||
If STRICT == 3, it means checking is strict, but do not compare
|
||||
default parameter values. */
|
||||
|
||||
int
|
||||
compparms (parms1, parms2, strict)
|
||||
tree parms1, parms2;
|
||||
|
@ -1036,6 +1044,7 @@ compparms (parms1, parms2, strict)
|
|||
|
||||
/* This really wants return whether or not parameter type lists
|
||||
would make their owning functions assignment compatible or not. */
|
||||
|
||||
int
|
||||
comp_target_parms (parms1, parms2, strict)
|
||||
tree parms1, parms2;
|
||||
|
@ -1617,6 +1626,7 @@ build_object_ref (datum, basetype, field)
|
|||
|
||||
/* Like `build_component_ref, but uses an already found field.
|
||||
Must compute access for current_class_ref. Otherwise, ok. */
|
||||
|
||||
tree
|
||||
build_component_ref_1 (datum, field, protect)
|
||||
tree datum, field;
|
||||
|
@ -1689,6 +1699,7 @@ build_component_ref_1 (datum, field, protect)
|
|||
we're dealing with aggregates. So, we now call this in unary_complex_lvalue,
|
||||
and in build_modify_expr. The case (in particular) that led to this was
|
||||
with CODE == ADDR_EXPR, since it's not an lvalue when we'd get it there. */
|
||||
|
||||
static tree
|
||||
rationalize_conditional_expr (code, t)
|
||||
enum tree_code code;
|
||||
|
@ -1704,6 +1715,7 @@ rationalize_conditional_expr (code, t)
|
|||
FIELD_DECL for the field. If not found return NULL_TREE. Because
|
||||
anonymous unions can nest, we must also search all anonymous unions
|
||||
that are directly reachable. */
|
||||
|
||||
static tree
|
||||
lookup_anon_field (t, type)
|
||||
tree t, type;
|
||||
|
@ -1739,6 +1751,7 @@ lookup_anon_field (t, type)
|
|||
/* Build a COMPONENT_REF for a given DATUM, and it's member COMPONENT.
|
||||
COMPONENT can be an IDENTIFIER_NODE that is the name of the member
|
||||
that we are interested in, or it can be a FIELD_DECL. */
|
||||
|
||||
tree
|
||||
build_component_ref (datum, component, basetype_path, protect)
|
||||
tree datum, component, basetype_path;
|
||||
|
@ -1752,7 +1765,8 @@ build_component_ref (datum, component, basetype_path, protect)
|
|||
if (current_template_parms)
|
||||
return build_min_nt (COMPONENT_REF, datum, component);
|
||||
|
||||
/* If DATUM is a COMPOUND_EXPR or COND_EXPR, move our reference inside it. */
|
||||
/* If DATUM is a COMPOUND_EXPR or COND_EXPR, move our reference
|
||||
inside it. */
|
||||
switch (TREE_CODE (datum))
|
||||
{
|
||||
case COMPOUND_EXPR:
|
||||
|
@ -2076,13 +2090,13 @@ build_indirect_ref (ptr, errorstring)
|
|||
will inherit the type of the array, which will be some pointer type. */
|
||||
|
||||
tree
|
||||
build_x_array_ref (array, index)
|
||||
tree array, index;
|
||||
build_x_array_ref (array, idx)
|
||||
tree array, idx;
|
||||
{
|
||||
tree rval = build_opfncall (ARRAY_REF, LOOKUP_NORMAL, array, index, NULL_TREE);
|
||||
tree rval = build_opfncall (ARRAY_REF, LOOKUP_NORMAL, array, idx, NULL_TREE);
|
||||
if (rval)
|
||||
return rval;
|
||||
return build_array_ref (array, index);
|
||||
return build_array_ref (array, idx);
|
||||
}
|
||||
|
||||
tree
|
||||
|
@ -2458,7 +2472,7 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
|
|||
|
||||
if (TYPE_PTRMEMFUNC_P (TREE_TYPE (function)))
|
||||
{
|
||||
tree fntype, index, e1, delta, delta2, e2, e3, aref, vtbl;
|
||||
tree fntype, idx, e1, delta, delta2, e2, e3, aref, vtbl;
|
||||
tree instance;
|
||||
|
||||
tree instance_ptr = *instance_ptrptr;
|
||||
|
@ -2470,10 +2484,10 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
|
|||
function = save_expr (function);
|
||||
|
||||
fntype = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (function));
|
||||
index = save_expr (build_component_ref (function,
|
||||
idx = save_expr (build_component_ref (function,
|
||||
index_identifier,
|
||||
NULL_TREE, 0));
|
||||
e1 = build (GT_EXPR, boolean_type_node, index,
|
||||
e1 = build (GT_EXPR, boolean_type_node, idx,
|
||||
convert (delta_type_node, integer_zero_node));
|
||||
delta = convert (ptrdiff_type_node,
|
||||
build_component_ref (function, delta_identifier, NULL_TREE, 0));
|
||||
|
@ -2493,7 +2507,7 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
|
|||
vtbl, convert (ptrdiff_type_node, delta2));
|
||||
vtbl = build_indirect_ref (vtbl, NULL_PTR);
|
||||
aref = build_array_ref (vtbl, build_binary_op (MINUS_EXPR,
|
||||
index,
|
||||
idx,
|
||||
integer_one_node, 1));
|
||||
if (! flag_vtable_thunks)
|
||||
{
|
||||
|
@ -4033,6 +4047,7 @@ condition_conversion (expr)
|
|||
|
||||
NOCONVERT nonzero suppresses the default promotions
|
||||
(such as from short to int). */
|
||||
|
||||
tree
|
||||
build_unary_op (code, xarg, noconvert)
|
||||
enum tree_code code;
|
||||
|
@ -4648,6 +4663,10 @@ mark_addressable (exp)
|
|||
TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
|
||||
return 1;
|
||||
|
||||
case CONSTRUCTOR:
|
||||
TREE_ADDRESSABLE (x) = 1;
|
||||
return 1;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
@ -4915,8 +4934,13 @@ build_conditional_expr (ifexp, op1, op2)
|
|||
a type is done using NOP_EXPRs. */
|
||||
if (code1 == RECORD_TYPE && TYPE_HAS_CONVERSION (type1))
|
||||
{
|
||||
tree tmp = build_pointer_type
|
||||
/* There are other types besides pointers and records. */
|
||||
tree tmp;
|
||||
if (code2 == POINTER_TYPE)
|
||||
tmp = build_pointer_type
|
||||
(build_type_variant (TREE_TYPE (type2), 1, 1));
|
||||
else
|
||||
tmp = type2;
|
||||
tmp = build_type_conversion (CONVERT_EXPR, tmp, op1, 0);
|
||||
if (tmp == NULL_TREE)
|
||||
{
|
||||
|
@ -4928,13 +4952,18 @@ build_conditional_expr (ifexp, op1, op2)
|
|||
error ("ambiguous pointer conversion");
|
||||
else
|
||||
STRIP_NOPS (tmp);
|
||||
result_type = common_type (type1, TREE_TYPE (tmp));
|
||||
result_type = common_type (type2, TREE_TYPE (tmp));
|
||||
op1 = tmp;
|
||||
}
|
||||
else if (code2 == RECORD_TYPE && TYPE_HAS_CONVERSION (type2))
|
||||
{
|
||||
tree tmp = build_pointer_type
|
||||
tree tmp;
|
||||
if (code1 == POINTER_TYPE)
|
||||
tmp = build_pointer_type
|
||||
(build_type_variant (TREE_TYPE (type1), 1, 1));
|
||||
else
|
||||
tmp = type1;
|
||||
|
||||
tmp = build_type_conversion (CONVERT_EXPR, tmp, op2, 0);
|
||||
if (tmp == NULL_TREE)
|
||||
{
|
||||
|
@ -4976,6 +5005,7 @@ build_conditional_expr (ifexp, op1, op2)
|
|||
|
||||
/* Handle overloading of the ',' operator when needed. Otherwise,
|
||||
this function just builds an expression list. */
|
||||
|
||||
tree
|
||||
build_x_compound_expr (list)
|
||||
tree list;
|
||||
|
@ -5054,6 +5084,12 @@ tree
|
|||
build_static_cast (type, expr)
|
||||
tree type, expr;
|
||||
{
|
||||
if (current_template_parms)
|
||||
{
|
||||
tree t = build_min (STATIC_CAST_EXPR, type, expr);
|
||||
return t;
|
||||
}
|
||||
|
||||
return build_c_cast (type, expr, 0);
|
||||
}
|
||||
|
||||
|
@ -5118,6 +5154,12 @@ build_const_cast (type, expr)
|
|||
if (type == error_mark_node || expr == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
if (current_template_parms)
|
||||
{
|
||||
tree t = build_min (CONST_CAST_EXPR, type, expr);
|
||||
return t;
|
||||
}
|
||||
|
||||
if (TYPE_PTRMEMFUNC_P (type))
|
||||
type = TYPE_PTRMEMFUNC_FN_TYPE (type);
|
||||
if (TYPE_PTRMEMFUNC_P (intype))
|
||||
|
@ -5389,8 +5431,8 @@ expand_target_expr (t)
|
|||
to combine the old value of LHS with RHS to get the new value.
|
||||
Or else MODIFYCODE is NOP_EXPR meaning do a simple assignment.
|
||||
|
||||
C++: If MODIFYCODE is INIT_EXPR, then leave references unbashed.
|
||||
*/
|
||||
C++: If MODIFYCODE is INIT_EXPR, then leave references unbashed. */
|
||||
|
||||
tree
|
||||
build_modify_expr (lhs, modifycode, rhs)
|
||||
tree lhs;
|
||||
|
@ -5903,6 +5945,7 @@ language_lvalue_valid (exp)
|
|||
/* Get difference in deltas for different pointer to member function
|
||||
types. Return integer_zero_node, if FROM cannot be converted to a
|
||||
TO type. If FORCE is true, then allow reverse conversions as well. */
|
||||
|
||||
static tree
|
||||
get_delta_difference (from, to, force)
|
||||
tree from, to;
|
||||
|
@ -5980,7 +6023,7 @@ build_ptrmemfunc (type, pfn, force)
|
|||
tree type, pfn;
|
||||
int force;
|
||||
{
|
||||
tree index = integer_zero_node;
|
||||
tree idx = integer_zero_node;
|
||||
tree delta = integer_zero_node;
|
||||
tree delta2 = integer_zero_node;
|
||||
tree vfield_offset;
|
||||
|
@ -6000,17 +6043,17 @@ build_ptrmemfunc (type, pfn, force)
|
|||
tree e1, e2, e3;
|
||||
ndelta = convert (ptrdiff_type_node, build_component_ref (pfn, delta_identifier, NULL_TREE, 0));
|
||||
ndelta2 = convert (ptrdiff_type_node, DELTA2_FROM_PTRMEMFUNC (pfn));
|
||||
index = build_component_ref (pfn, index_identifier, NULL_TREE, 0);
|
||||
idx = build_component_ref (pfn, index_identifier, NULL_TREE, 0);
|
||||
delta = get_delta_difference (TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (pfn)))),
|
||||
TYPE_METHOD_BASETYPE (TREE_TYPE (type)),
|
||||
force);
|
||||
delta = build_binary_op (PLUS_EXPR, delta, ndelta, 1);
|
||||
delta2 = build_binary_op (PLUS_EXPR, ndelta2, delta2, 1);
|
||||
e1 = fold (build (GT_EXPR, boolean_type_node, index, integer_zero_node));
|
||||
e1 = fold (build (GT_EXPR, boolean_type_node, idx, integer_zero_node));
|
||||
|
||||
u = build_nt (CONSTRUCTOR, NULL_TREE, tree_cons (delta2_identifier, delta2, NULL_TREE));
|
||||
u = build_nt (CONSTRUCTOR, NULL_TREE, tree_cons (NULL_TREE, delta,
|
||||
tree_cons (NULL_TREE, index,
|
||||
tree_cons (NULL_TREE, idx,
|
||||
tree_cons (NULL_TREE, u, NULL_TREE))));
|
||||
e2 = digest_init (TYPE_GET_PTRMEMFUNC_TYPE (type), u, (tree*)0);
|
||||
|
||||
|
@ -6020,7 +6063,7 @@ build_ptrmemfunc (type, pfn, force)
|
|||
|
||||
u = build_nt (CONSTRUCTOR, NULL_TREE, tree_cons (pfn_identifier, npfn, NULL_TREE));
|
||||
u = build_nt (CONSTRUCTOR, NULL_TREE, tree_cons (NULL_TREE, delta,
|
||||
tree_cons (NULL_TREE, index,
|
||||
tree_cons (NULL_TREE, idx,
|
||||
tree_cons (NULL_TREE, u, NULL_TREE))));
|
||||
e3 = digest_init (TYPE_GET_PTRMEMFUNC_TYPE (type), u, (tree*)0);
|
||||
return build_conditional_expr (e1, e2, e3);
|
||||
|
@ -6105,14 +6148,14 @@ build_ptrmemfunc (type, pfn, force)
|
|||
delta2 = size_binop (PLUS_EXPR, vfield_offset, delta2);
|
||||
|
||||
/* Map everything down one to make room for the null pointer to member. */
|
||||
index = size_binop (PLUS_EXPR,
|
||||
idx = size_binop (PLUS_EXPR,
|
||||
DECL_VINDEX (TREE_OPERAND (pfn, 0)),
|
||||
integer_one_node);
|
||||
u = build_nt (CONSTRUCTOR, NULL_TREE, tree_cons (delta2_identifier, delta2, NULL_TREE));
|
||||
}
|
||||
else
|
||||
{
|
||||
index = size_binop (MINUS_EXPR, integer_zero_node, integer_one_node);
|
||||
idx = size_binop (MINUS_EXPR, integer_zero_node, integer_one_node);
|
||||
|
||||
if (type == TREE_TYPE (pfn))
|
||||
{
|
||||
|
@ -6128,7 +6171,7 @@ build_ptrmemfunc (type, pfn, force)
|
|||
}
|
||||
|
||||
u = build_nt (CONSTRUCTOR, NULL_TREE, tree_cons (NULL_TREE, delta,
|
||||
tree_cons (NULL_TREE, index,
|
||||
tree_cons (NULL_TREE, idx,
|
||||
tree_cons (NULL_TREE, u, NULL_TREE))));
|
||||
return digest_init (TYPE_GET_PTRMEMFUNC_TYPE (type), u, (tree*)0);
|
||||
}
|
||||
|
@ -6612,6 +6655,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
|
|||
exist, an ambiguity exists.
|
||||
|
||||
If flags doesn't include LOOKUP_COMPLAIN, don't complain about anything. */
|
||||
|
||||
tree
|
||||
convert_for_initialization (exp, type, rhs, flags, errtype, fndecl, parmnum)
|
||||
tree exp, type, rhs;
|
||||
|
@ -7063,6 +7107,8 @@ c_expand_return (retval)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* We already did this above, don't do it again. */
|
||||
if (TREE_CODE (valtype) != REFERENCE_TYPE)
|
||||
retval = convert_for_initialization (result, valtype, retval,
|
||||
LOOKUP_NORMAL,
|
||||
"return", NULL_TREE, 0);
|
||||
|
@ -7186,18 +7232,18 @@ c_expand_start_case (exp)
|
|||
}
|
||||
else
|
||||
{
|
||||
tree index;
|
||||
tree idx;
|
||||
|
||||
exp = default_conversion (exp);
|
||||
type = TREE_TYPE (exp);
|
||||
index = get_unwidened (exp, 0);
|
||||
idx = get_unwidened (exp, 0);
|
||||
/* We can't strip a conversion from a signed type to an unsigned,
|
||||
because if we did, int_fits_type_p would do the wrong thing
|
||||
when checking case values for being in range,
|
||||
and it's too hard to do the right thing. */
|
||||
if (TREE_UNSIGNED (TREE_TYPE (exp))
|
||||
== TREE_UNSIGNED (TREE_TYPE (index)))
|
||||
exp = index;
|
||||
== TREE_UNSIGNED (TREE_TYPE (idx)))
|
||||
exp = idx;
|
||||
}
|
||||
|
||||
expand_start_case
|
||||
|
@ -7209,6 +7255,7 @@ c_expand_start_case (exp)
|
|||
|
||||
/* CONSTP remembers whether or not all the intervening pointers in the `to'
|
||||
type have been const. */
|
||||
|
||||
int
|
||||
comp_ptr_ttypes_real (to, from, constp)
|
||||
tree to, from;
|
||||
|
@ -7242,6 +7289,7 @@ comp_ptr_ttypes_real (to, from, constp)
|
|||
/* When comparing, say, char ** to char const **, this function takes the
|
||||
'char *' and 'char const *'. Do not pass non-pointer types to this
|
||||
function. */
|
||||
|
||||
int
|
||||
comp_ptr_ttypes (to, from)
|
||||
tree to, from;
|
||||
|
|
|
@ -44,6 +44,7 @@ extern int sorrycount;
|
|||
|
||||
/* Print an error message stemming from an attempt to use
|
||||
BASETYPE as a base class for TYPE. */
|
||||
|
||||
tree
|
||||
error_not_base_type (basetype, type)
|
||||
tree basetype, type;
|
||||
|
@ -75,6 +76,7 @@ binfo_or_else (parent_or_type, type)
|
|||
value may not be changed thereafter. Thus, we emit hard errors for these,
|
||||
rather than just pedwarns. If `SOFT' is 1, then we just pedwarn. (For
|
||||
example, conversions to references.) */
|
||||
|
||||
void
|
||||
readonly_error (arg, string, soft)
|
||||
tree arg;
|
||||
|
@ -122,6 +124,7 @@ readonly_error (arg, string, soft)
|
|||
|
||||
/* Print an error message for invalid use of a type which declares
|
||||
virtual functions which are not inheritable. */
|
||||
|
||||
void
|
||||
abstract_virtuals_error (decl, type)
|
||||
tree decl;
|
||||
|
@ -167,6 +170,7 @@ abstract_virtuals_error (decl, type)
|
|||
/* Print an error message for invalid use of a signature type.
|
||||
Signatures are treated similar to abstract classes here, they
|
||||
cannot be instantiated. */
|
||||
|
||||
void
|
||||
signature_error (decl, type)
|
||||
tree decl;
|
||||
|
@ -253,6 +257,7 @@ incomplete_type_error (value, type)
|
|||
}
|
||||
|
||||
/* Like error(), but don't call report_error_function(). */
|
||||
|
||||
static void
|
||||
ack (s, v, v2)
|
||||
char *s;
|
||||
|
@ -1182,9 +1187,7 @@ process_init_constructor (type, init, elts)
|
|||
|
||||
x.A::ii refers to the ii member of the L part of
|
||||
of A part of the C object named by X. In this case,
|
||||
DATUM would be x, and BASETYPE would be A.
|
||||
|
||||
*/
|
||||
DATUM would be x, and BASETYPE would be A. */
|
||||
|
||||
tree
|
||||
build_scoped_ref (datum, basetype)
|
||||
|
@ -1242,6 +1245,7 @@ build_scoped_ref (datum, basetype)
|
|||
performed until an object which does not have the `->' operator
|
||||
overloaded is found. An error is reported when circular pointer
|
||||
delegation is detected. */
|
||||
|
||||
tree
|
||||
build_x_arrow (datum)
|
||||
tree datum;
|
||||
|
@ -1320,6 +1324,7 @@ build_x_arrow (datum)
|
|||
As a special case, if there is only one method by that name,
|
||||
it is returned. Otherwise we return an expression which other
|
||||
routines will have to know how to deal with later. */
|
||||
|
||||
tree
|
||||
build_m_component_ref (datum, component)
|
||||
tree datum, component;
|
||||
|
@ -1378,6 +1383,7 @@ build_m_component_ref (datum, component)
|
|||
}
|
||||
|
||||
/* Return a tree node for the expression TYPENAME '(' PARMS ')'. */
|
||||
|
||||
tree
|
||||
build_functional_cast (exp, parms)
|
||||
tree exp;
|
||||
|
@ -1464,6 +1470,7 @@ build_functional_cast (exp, parms)
|
|||
|
||||
/* Return the character string for the name that encodes the
|
||||
enumeral value VALUE in the domain TYPE. */
|
||||
|
||||
char *
|
||||
enum_name_string (value, type)
|
||||
tree value;
|
||||
|
@ -1495,6 +1502,7 @@ enum_name_string (value, type)
|
|||
TYPE is the type of the switch index expression.
|
||||
NEW is the new value that we were trying to add.
|
||||
OLD is the old value that stopped us from adding it. */
|
||||
|
||||
void
|
||||
report_case_error (code, type, new_value, old_value)
|
||||
int code;
|
||||
|
|
|
@ -569,6 +569,7 @@ gen_assign(xf, name)
|
|||
of CLS.
|
||||
|
||||
??? Needs to handle nested classes. */
|
||||
|
||||
void
|
||||
GNU_xref_hier(cls, base, pub, virt, frnd)
|
||||
char *cls;
|
||||
|
|
Loading…
Reference in New Issue