Age | Commit message (Collapse) | Author | Files | Lines |
|
* c-common.c (vector_types_convertible_p,
decl_with_nonnull_addr_p, c_promoting_integer_type_p,
self_promoting_args_p): Constify.
* c-common.h (has_c_linkage, decl_with_nonnull_addr_p,
c_promoting_integer_type_p, self_promoting_args_p,
anon_aggr_type_p, vector_types_convertible_p): Likewise.
* c-decl.c (anon_aggr_type_p): Likewise.
* * c-dump.c (dump_stmt): Likewise.
* c-objc-common.c (has_c_linkage): Likewise.
* c-tree.h (same_translation_unit_p): Likewise.
* c-typeck.c (null_pointer_constant_p,
tagged_types_tu_compatible_p, function_types_compatible_p,
type_lists_compatible_p, lvalue_or_else, lvalue_p,
comptypes_internal, struct tagged_tu_seen_cache,
same_translation_unit_p, alloc_tagged_tu_seen_cache,
c_size_in_bytes): Likewise.
* ggc-common.c (compare_ptr_data, hash_descriptor, eq_descriptor,
hash_ptr, eq_ptr): Likewise.
* langhooks-def.h (lhd_decl_ok_for_sibcall,
LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Likewise.
* langhooks.c (lhd_decl_ok_for_sibcall): Likewise.
* langhooks.h (ok_for_sibcall, omp_privatize_by_reference):
Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.h (optab_for_tree_code): Likewise.
* rtl.h (simplify_rtx): Likewise.
* simplify-rtx.c (simplify_rtx): Likewise.
* tree-dump.c (queue, queue_and_dump_index, queue_and_dump_type,
dump_flag, dump_node): Likewise.
* tree-dump.h (struct dump_info, dump_stmt, queue_and_dump_index,
queue_and_dump_type, dump_flag): Likewise.
* tree-flow.h (vect_can_force_dr_alignment_p): Likewise.
* tree-pass.h (dump_node): Likewise.
* tree-vectorizer.c (vect_can_force_dr_alignment_p,
supportable_narrowing_operation): Likewise.
* tree-vectorizer.h (vect_can_force_dr_alignment_p,
supportable_narrowing_operation): Likewise.
* tree-vrp.c (needs_overflow_infinity, supports_overflow_infinity,
is_negative_overflow_infinity, is_positive_overflow_infinity,
is_overflow_infinity, vrp_val_is_max, vrp_val_is_min,
nonnull_arg_p, get_value_range, vrp_operand_equal_p,
update_value_range, add_equivalence, ssa_name_nonnegative_p,
ssa_name_nonzero_p, fp_predicate): Likewise.
* tree.c (auto_var_in_fn_p, empty_body_p): Likewise.
* tree.h (empty_body_p, auto_var_in_fn_p, ssa_name_nonzero_p,
ssa_name_nonnegative_p): Likewise.
cp:
* call.c (sufficient_parms_p): Constify.
* class.c (same_signature_p): Likewise.
* cp-gimplify.c (is_invisiref_parm,
cxx_omp_privatize_by_reference): Likewise.
* cp-objcp-common.c (has_c_linkage): Likewise.
* cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
num_artificial_parms_for, comp_template_parms,
template_parameter_pack_p, any_dependent_template_arguments_p,
any_type_dependent_arguments_p, any_value_dependent_elements_p,
repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
zero_init_p, member_p, cp_lvalue_kind,
builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
varargs_function_p, is_dummy_object, special_function_kind,
string_conv_p, type_unknown_p, comp_except_specs, compparms,
comp_cv_qualification, is_bitfield_expr_with_lowered_type,
unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
cp_has_mutable_p, at_least_as_qualified_p,
invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
* decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
* except.c (nothrow_libfn_p): Likewise.
* method.c (skip_artificial_parms_for, num_artificial_parms_for):
Likewise.
* pt.c (comp_template_parms, template_parameter_pack_p,
any_type_dependent_arguments_p, any_value_dependent_elements_p,
any_dependent_template_arguments_p): Likewise.
* repo.c (repo_export_class_p): Likewise.
* semantics.c (anon_aggr_type_p): Likewise.
* tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
varargs_function_p, member_p, is_dummy_object, pod_type_p,
zero_init_p, special_function_p): Likewise.
* typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
compparms, invalid_nonstatic_memfn_p,
is_bitfield_expr_with_lowered_type, unlowered_expr_type,
string_conv_p, ptr_reasonably_similar, cp_type_readonly,
cp_has_mutable_p, lvalue_or_else): Likewise.
fortran:
* trans-openmp.c (gfc_omp_privatize_by_reference): Constify.
* trans.h (gfc_omp_privatize_by_reference): Likewise.
java:
* lang.c (java_decl_ok_for_sibcall): Likewise.
From-SVN: r127799
|
|
2007-08-25 Paolo Bonzini <bonzini@gnu.org>
* decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
* cp-objcp-common.c (cp_tree_size): Ditto.
* tree.c (cp_walk_subtrees): Ditto
* cp-tree.def (TINST_LEVEL): Go away.
* cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
move together with other non-tree structs.
(enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
(union lang_tree_node): Eliminate tinst_level field.
(TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
(current_instantiation, outermost_tinst_level): Return
a "struct tinst_level *".
* error.c (print_instantiation_partial_context): Change second
parameter to a "struct tinst_level *". Replace accessor macros
with field access.
(print_instantiation_full_context): Likewise.
* lex.c (in_main_input_context): Likewise.
* pt.c (struct pending_templates): New.
(pending_templates, last_pending_template): Use it as a type.
(current_tinst_level): Change typo to "struct tinst_level *"
(reopen_tinst_level): Accept "struct tinst_level *", return decl.
(add_pending_template): Construct a "struct pending_template".
Replace TINST_LEVEL accessor macros with field access.
(push_tinst_level): Likewise, using GGC_NEW instead of make_node.
(pop_tinst_level): Likewise.
(instantiate_pending_templates): Likewise. Factor common code used
when an instantiation has been done.
(outermost_tinst_level): Replace tree_last with loop.
(current_instantiation): Return a "struct tinst_level *".
From-SVN: r127796
|
|
functions)
2007-08-20 Richard Guenther <rguenther@suse.de>
PR c++/22369
PR c++/22451
* call.c (build_new_method_call): Convert initializer to
the basetype.
* init.c (build_aggr_init): Do not fiddle with types.
(build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
* except.c (build_throw): Do not drop qualifiers for the
pointer type.
* typeck.c (get_member_function_from_ptrfunc): Do not
fiddle with types, instead convert.
(build_ptrmemfunc1): Convert to the target type for
initialization.
(gfc_trans_allocate): Convert result to target type.
* cp-objcp-common.c (cxx_get_alias_set): Pointers to
pointer-to-member structures shall have alias set zero as well.
From-SVN: r127647
|
|
* c-common.c (const_strip_array_types): New.
* c-common.h (lang_missing_noreturn_ok_p): Delete.
(const_strip_array_types): New.
* c-objc-common.c (c_disregard_inline_limits,
c_warn_unused_global_decl): Constify.
* c-tree.h (c_disregard_inline_limits, c_warn_unused_global_decl,
c_vla_type_p, c_incomplete_type_error): Likewise.
* c-typeck.c (c_incomplete_type_error, c_vla_type_p): Likewise.
* hooks.c (hook_bool_const_tree_false): New.
* hooks.h (hook_bool_const_tree_false): Likewise.
* langhooks-def.h (lhd_warn_unused_global_decl,
lhd_incomplete_type_error, lhd_expr_size,
lhd_tree_inlining_disregard_inline_limits,
lhd_tree_inlining_auto_var_in_fn_p, lhd_tree_dump_type_quals,
LANG_HOOKS_GENERIC_TYPE_P, LANG_HOOKS_TYPE_MAX_SIZE): Constify.
* langhooks.c (lhd_warn_unused_global_decl,
lhd_incomplete_type_error,
lhd_tree_inlining_disregard_inline_limits,
lhd_tree_inlining_auto_var_in_fn_p, lhd_tree_dump_type_quals,
lhd_expr_size): Likewise.
* langhooks.h (lang_hooks_for_tree_inlining,
lang_hooks_for_tree_dump, lang_hooks_for_types,
lang_hooks_for_decls, lang_hooks): Likewise.
* pointer-set.c (pointer_set_t, pointer_set_create,
pointer_set_contains, insert_aux, pointer_set_insert,
pointer_set_traverse, pointer_map_t, pointer_map_create,
pointer_map_contains, pointer_map_insert, pointer_map_traverse):
Likewise.
* pointer-set.h (pointer_set_contains, pointer_set_insert,
pointer_set_traverse, pointer_map_contains, pointer_map_insert,
pointer_map_traverse): Likewise.
* predict.c (assert_is_empty): Likewise.
* tree-affine.c (free_name_expansion): Likewise.
* tree-cfg.c (edge_to_cases_cleanup): Likewise.
* tree.c (size_in_bytes, max_int_size_in_bytes): Likewise.
* tree.h (size_in_bytes, max_int_size_in_bytes): Likewise.
ada:
* misc.c (gnat_type_max_size): Constify.
cp:
* cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
Constify.
* cp-tree.h (local_variable_p, nonstatic_local_decl_p,
class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
* tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
* typeck.c (cp_type_quals): Likewise.
* typeck2.c (cxx_incomplete_type_diagnostic,
cxx_incomplete_type_error): Likewise.
From-SVN: r127560
|
|
./: * alias.h (alias_set_type): Define new type.
(ALIAS_SET_MEMORY_BARRIER): Use it.
* rtl.h: Include alias.h.
(struct mem_attrs): Use alias_set_type.
* tree.h: Include alias.h
(struct tree_type): Use alias_set_type.
(struct tree_struct_field_tag): Likewise.
(struct tree_decl_common): Likewise.
* alias.c (struct alias_set_entry): Use alias_set_type.
(get_alias_set_entry, alias_set_subset_of): Likewise.
(alias_sets_conflict_p): Likewise.
(alias_sets_must_conflict_p): Likewise.
(objects_must_conflict_p): Likewise.
(get_alias_set, new_alias_set): Likewise.
(record_alias_subset, record_component_aliases): Likewise.
(varargs_set, frame_set): Change to alias_set_type.
(get_varargs_alias_set): Use alias_set_type.
(get_frame_alias_set): Likewise.
* builtins.c (setjmp_alias_set): Change to alias_set_type.
* dse.c (struct store_info): Use alias_set_type.
(struct read_info, struct clear_alias_mode_holder): Likewise.
(clear_alias_set_lookup, canon_address): Likewise.
(record_store, check_mem_read_rtx): Likewise.
(dse_record_singleton_alias_set): Likewise.
(dse_invalidate_singleton_alias_set): Likewise.
* emit-rtl.c (get_mem_attrs): Likewise.
(set_mem_attributes_minus_bitpos): Likewise.
(set_mem_alias_set): Likewise.
* expr.c (store_constructor_field, store_field): Likewise.
* gimplify.c (struct gimplify_init_ctor_preeval_data): Likewise.
* langhooks.c (lhd_get_alias_set): Likewise.
* langhooks-def.h (lhd_get_alias_set): Likewise.
* reload1.c (alter_reg): Likewise.
* tree-flow.h (struct fieldoff): Likewise.
* tree-ssa-alias.c (struct alias_map_d): Likewise.
(may_alias_p, get_smt_for, create_sft): Likewise.
* tree-ssa-alias-warnings.c (nonstandard_alias_types_p): Likewise.
* tree-ssa-structalias.c (set_uids_in_ptset): Likewise.
(merge_smts_into): Likewise.
* varasm.c (const_alias_set): Likewise.
* c-common.c (strict_aliasing_warning): Likewise.
(c_common_get_alias_set): Likewise.
* dse.h (dse_record_singleton_alias_set): Update declaration.
(dse_invalidate_singleton_alias_set): Likewise.
* emit-rtl.h (set_mem_alias_set): Likewise.
* c-common.h (c_common_get_alias_set): Likewise.
* print-rtl.c (print_rtx): Cast MEM_ALIAS_SET when printing it.
* print-tree.c (print_node): Likewise.
* config/alpha/alpha.c (alpha_sr_alias_set): Change to
alias_set_type.
(alpha_setup_incoming_varargs): Use alias_set_type.
* config/i386/i386.c (setup_incoming_varargs_64): Use
alias_set_type.
(setup_incoming_varargs_ms_64): Likewise.
(ix86_GOT_alias_set): Likewise.
* config/mn10300/mn10300.c (mn10300_builtin_saveregs): Likewise.
* config/rs6000/rs6000.c (setup_incoming_varargs): Likewise.
(set): Change to alias_set_type.
(get_TOC_alias_set): Use alias_set_type.
* config/rs6000/rs6000-protos.h (get_TOC_alias_set): Update
declaration.
* config/sh/sh.c (sh_builtin_saveregs): Use alias_set_type.
* config/sparc/sparc.c (sparc_sr_alias_set): Change to
alias_set_type.
(struct_value_alias_set): Likewise.
* Makefile.in (GTFILES): Add $(srcdir)/alias.h.
ada/:
* misc.c (gnat_get_alias_set): Change return type to
alias_set_type.
cp/:
* cp-objcp-common.c (cxx_get_alias_set): Change return type to
alias_set_type.
* cp/cp-tree.h (cxx_get_alias_set): Update declaration.
fortran:/
* f95-lang.c (gfc_get_alias_set): Change return type to
alias_set_type.
From-SVN: r127362
|
|
Public...
* typeck.c: Change copyright header to refer to version 3 of the GNU General
Public License and to point readers at the COPYING3 file and the FSF's license
web page.
* optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, config-lang.in,
cp-tree.def, call.c, decl.h, ptree.c, Make-lang.in, method.c, rtti.c,
cp-objcp-common.c, g++spec.c, cp-objcp-common.h, except.c, error.c,
operators.def, cvt.c, tree.c, mangle.c, cp-tree.h, dump.c, search.c,
friend.c, expr.c, cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c,
pt.c, cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
name-lookup.h, parser.c: Likewise.
From-SVN: r127154
|
|
Revert change removing staticp.
From-SVN: r123650
|
|
in /
2007-04-06 Daniel Berlin <dberlin@dberlin.org>
* tree.c (staticp): No longer use staticp langhook.
* langhooks.c (lhd_staticp): Removed.
* langhooks.h (struct lang_hooks): Remove staticp.
* c-common.c (c_staticp): Remove.
* c-common.h (c_staticp): Ditto.
* langhooks-defs.h (lhd_staticp): Ditto.
(LHD_HOOKS_STATICP): Ditto
* tree.h (gcc_assert_lowered): New macro.
in cp/
2007-04-06 Daniel Berlin <dberlin@dberlin.org>
* cp-objcp-common.c (cxx_staticp): Remove.
* cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
* cp-tree.h (cxx_staticp):
From-SVN: r123636
|
|
gcc/
2007-03-30 Paolo Carlini <pcarlini@suse.de>
PR c++/26099
* c-common.h (enum rid): Add RID_HAS_NOTHROW_ASSIGN,
RID_HAS_NOTHROW_CONSTRUCTOR, RID_HAS_NOTHROW_COPY,
RID_HAS_TRIVIAL_ASSIGN, RID_HAS_TRIVIAL_CONSTRUCTOR,
RID_HAS_TRIVIAL_COPY, RID_HAS_TRIVIAL_DESTRUCTOR,
RID_HAS_VIRTUAL_DESTRUCTOR, RID_IS_ABSTRACT, RID_IS_BASE_OF,
RID_IS_CONVERTIBLE_TO, RID_IS_CLASS, RID_IS_EMPTY, RID_IS_ENUM,
RID_IS_POD, RID_IS_POLYMORPHIC, RID_IS_UNION, as
C++ extensions.
* doc/extend.texi (Extensions to the C++ Language): Add Type Traits.
gcc/cp/
2007-03-30 Paolo Carlini <pcarlini@suse.de>
PR c++/26099
* cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
(enum cp_tree_node_structure_enum, union lang_tree_node): Update.
(CLASS_TYPE_NON_UNION_P): Add.
(struct lang_type_class): Add has_complex_dflt.
(TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
(locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
* cp-tree.def: Add TRAIT_EXPR.
* cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
* lex.c (struct resword): Add __has_nothrow_assign,
__has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
__has_trivial_constructor, __has_trivial_copy,
__has_trivial_destructor, __has_virtual_destructor, __is_abstract,
__is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
__is_pod, __is_polymorphic, __is_union.
* parser.c (cp_parser_primary_expression): Deal with the new RIDs.
(cp_parser_trait_expr): New.
* semantics.c (finish_trait_expr, trait_expr_value
classtype_has_nothrow_copy_or_assign_p): New.
* method.c (locate_copy, locate_ctor, locate_dtor): Do not define
as static.
* decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
* class.c (check_bases, check_field_decl, check_bases_and_members):
Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
* pt.c (uses_template_parms, tsubst_copy_and_build,
value_dependent_expression_p, type_dependent_expression_p): Deal with
TRAIT_EXPR.
* tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
gcc/testsuite/
2007-03-30 Paolo Carlini <pcarlini@suse.de>
PR c++/26099
* g++.dg/ext/is_base_of.C: New.
* g++.dg/ext/has_virtual_destructor.C: New.
* g++.dg/ext/is_polymorphic.C: New.
* g++.dg/ext/is_base_of_diagnostic.C: New.
* g++.dg/ext/is_enum.C: New.
* g++.dg/ext/has_nothrow_assign.C: New.
* g++.dg/ext/has_nothrow_constructor.C: New.
* g++.dg/ext/is_empty.C: New.
* g++.dg/ext/has_trivial_copy.C: New.
* g++.dg/ext/has_trivial_assign.C: New.
* g++.dg/ext/is_abstract.C: New.
* g++.dg/ext/is_pod.C: New.
* g++.dg/ext/has_nothrow_copy.C: New.
* g++.dg/ext/is_class.C: New.
* g++.dg/ext/has_trivial_constructor.C: New.
* g++.dg/ext/is_union.C: New.
* g++.dg/ext/has_trivial_destructor.C: New.
* g++.dg/tree-ssa/pr22444.C: Adjust, avoid __is_pod.
* g++.dg/template/crash43.C: Likewise.
libstdc++-v3/
2007-03-30 Paolo Carlini <pcarlini@suse.de>
PR c++/26099
* include/bits/cpp_type_traits.h (struct __is_pod, struct __is_empty):
Remove.
* include/bits/valarray_array.h: Adjust.
* include/bits/allocator.h: Likewise.
* include/bits/stl_tree.h: Likewise.
From-SVN: r123366
|
|
2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
PR c++/20599
* typeck.c (check_return_expr): Check for bare parameter packs.
(comptypes): Compare template parameter packs and
type pack expansions.
* decl.c (grokdeclarator): Deal with the declaration of function
parameter packs.
(grokparms): Verify that the (optional) function parameter pack is
at the end of the parameter list.
(xref_basetypes): Handle pack expansions in the base class.
(cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
* cp-tree.def (TYPE_ARGUMENT_PACK): New.
(NONTYPE_ARGUMENT_PACK): New.
(TYPE_PACK_EXPANSION): New.
(EXPR_PACK_EXPANSION): New.
(ARGUMENT_PACK_SELECT): New.
* cp-objcp-common.c (cp_tree_size): Compute size of
(NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
ARGUMENT_PACK_SELECT.
* error.c (dump_template_argument): Print template argument packs.
(dump_template_argument_list): Ditto.
(dump_template_parameter): Dump `...' for template type parameter
packs.
(dump_type): Dump TYPE_PACK_EXPANSION nodes.
(dump_parameters): Print function parameter packs.
(dump_template_parms): Print template argument packs.
(dump_expr): Dump EXPR_PACK_EXPANSION nodes.
(maybe_warn_variadic_templates): New.
* operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
* tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
CAST_EXPR.
* mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
(write_template_arg): Write argument packs as separate arguments.
* cp-tree.h (struct template_parm_index_s): Add flag that
indicates that the template parameter is actually a parameter
pack.
(struct tree_argument_pack_select): New.
(enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
(union lang_tree_node): Add argument_pack_select.
(FUNCTION_PARAMETER_PACK_P): New.
(PACK_EXPANSION_P): New.
(PACK_EXPANSION_PATTERN): New.
(SET_PACK_EXPANSION_PATTERN): New.
(PACK_EXPANSION_PARAMETER_PACKS): New.
(ARGUMENT_PACK_P): New.
(ARGUMENT_PACK_ARGS): New.
(SET_ARGUMENT_PACK_ARGS): New.
(ARGUMENT_PACK_INCOMPLETE_P): New.
(ARGUMENT_PACK_EXPLICIT_ARGS): New.
(TEMPLATE_PARM_PARAMETER_PACK): New.
(TEMPLATE_TYPE_PARAMETER_PACK): New.
(ARGUMENT_PACK_SELECT_FROM_PACK): New.
(ARGUMENT_PACK_SELECT_INDEX): New.
(ARGUMENT_PACK_SELECT_ARG): New.
(struct cp_declarator): Add parameter_pack_p flag.
(maybe_warn_variadic_templates): Declare.
(process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
indicate a template parameter pack.
(uses_parameter_packs): Declare.
(template_parameter_pack_p): Declare.
(template_parms_variadic_p): Declare.
(make_pack_expansion): Declare.
(check_for_bare_parameter_packs): Declare.
* cxx-pretty-print.c (pp_cxx_unary_expression): Print
sizeof... expressions.
(pp_cxx_expression): Print pack expansions and non-type argument
packs.
(pp_cxx_exception_specification): Print pack expansions.
(pp_cxx_direct_declarator): Print ellipsis for parameter packs.
(pp_cxx_ctor_initializer): Print pack expansions.
(pp_cxx_type_id): Print pack expansions.
(pp_cxx_template_argument_list): Print argument packs.
(pp_cxx_template_parameter): Print ellipsis for template parameter
packs.
* pt.c (comp_template_parms): Compare template parameter packs.
(template_parameter_pack_p): New.
(template_parms_variadic_p): New.
(template_args_variadic_p): New.
(make_ith_pack_parameter_name): New.
(struct find_parameter_pack_data): New.
(find_parameter_packs_r): New.
(uses_parameter_packs): New.
(make_pack_expansion): New.
(check_for_bare_parameter_packs): New.
(expand_template_argument_pack): New.
(reduce_template_parm_level): Propagate parameter pack flag.
(process_template_parm): Add is_parameter_pack parameter to state
when the parameter is actually a parameter pack. Create template
parameter packs when is_parameter_pack is true.
(current_template_args): The argument for a template parameter
pack is an argument pack containing a single pack expansion.
(process_partial_specialization): When checking that non-type
argument expressions do not involve template parameters, loop over
the arguments in argument packs separately.
(push_template_decl_real): Check that the type of the declaration
does not have any bare parameter packs. Check that primary
templates have no more than one parameter pack, and that it comes
at the end of the template parameter list.
(convert_template_argument): Handle coercions for pack expansion
expressions by coercing the pattern then rebuilding the expansion.
(coerce_template_parms): When coercing the arguments for a
variadic template, pack "extra" arguments into an argument pack.
(coerce_template_template_parms): Cannot coerce between parameter
packs and non-pack parameters.
(template_args_equal): Compare PACK_EXPANSION_P expressions.
(comp_template_args): Expand all template arguments packs before
comparing template argument lists.
(mangle_class_name_for_template): Make argument packs as separate
template arguments.
(for_each_template_parm_r): No need to handle BASELINK.
(instantiate_class_template): Handle pack expansions in the base
class list.
(tsubst_pack_expansion): New.
(tsubst_template_args): Handle substitutions of argument packs and
pack expansion into template argument lists.
(tsubst_decl): Expand function parameter packs into separate
function parameters.
(tsubst_arg_types): Expand a type pack expansion into separate
argument types.
(tsubst_exception_specification): Handle pack expansions in
exception specifiers.
(tsubst): See through ARGUMENT_PACK_SELECT arguments when
replacing a template parameter with its argument. If we encounter
a substitution for an argument pack, just return the parameter
itself.
(tsubst_copy): sizeof(X...) returns the number of elements in
parameter pack X. See through ARGUMENT_PACK_SELECT when the
PARM_DECL is a parameter pack.
(tsubst_expr): Expression pack expansions and argument packs
cannot show up here; they will all be handled through function
calls, sizeof, and template argument lists.
(tsubst_copy_and_build): sizeof(X...) returns the number of
elements in parameter pack X. Handle pack expansions in TREE_LIST
and CONSTRUCTOR nodes.
(fn_type_unification): Handle "incomplete" explicit template
argument lists that specify some of the arguments for a template
parameter pack.
(type_unification_real): Unify arguments against pack expansions.
(template_parm_level_and_index): New, helper function.
(unify_pack_expansion): New.
(unify): Unify argument packs on an argument-by-argument basis,
handling variadic argument packs as well.
(more_specialized_fn): Handle unification of function parameter
packs. All things being equal, prefer non-variadic function
templates to variadic function templates.
(more_specialized_class): Prefer the variadic class template
partial specialization that binds fewer arguments to a parameter
pack.
(regenerate_decl_from_template): Expand function parameter packs
into separate parameters.
(instantiate_decl): Ditto.
(tsubst_initializer_list): Handle pack expansions for base-class
initializers.
(dependent_type_p_r): Determine dependent types in argument packs
and pack expansions.
(value_dependent_expression_p): Determine value-dependence of
non-type argument packs.
(dependent_template_arg_p): Handle argument packs.
* semantics.c (finish_cond): Check for bare parameter packs.
(finish_expr_stmt): Ditto.
(finish_for_expr): Ditto.
(finish_switch_cond): Ditto.
(finish_mem_initializers): Ditto.
* name-lookup.c (arg_assoc_type): Handle pack expansions and
argument packs.
* decl2.c (cp_build_parm_decl): Mark function parameter packs.
* parser.c (make_declarator): Declarator is not an expansion.
(make_pointer_declarator): Transfer parameter pack flag to outer
declarator.
(make_reference_declarator): Ditto.
(make_ptrmem_declarator): Ditto.
(make_call_declarator): Ditto.
(make_array_declarator): Ditto.
(cp_parser_postfix_expression): Allow pack expansion expressions
in the argument list for a call expression.
(cp_parser_parenthesized_expression_list): Add new parameter
ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
into separate arguments."
(cp_parser_new_placement): Allow pack expansion expressions.
(cp_parser_new_initializer): Ditto.
(cp_parser_mem_initializer_list): Allow ellipsis to create a
base-class initializer expansion.
(cp_parser_mem_initializer): Ditto.
(cp_parser_template_parameter_list): Keep track of whether the
template parameter is a template parameter pack.
(cp_parser_template_parameter): Parse the ellipsis to indicate a
template parameter pack.
(cp_parser_type_parameter): Ditto.
(cp_parser_template_argument_list): Parse the ellipsis to indicate
a pack expansion.
(cp_parser_direct_declarator): Parse the ellipsis to indicate that
this declarator is a parameter pack.
(cp_parser_parameter_declaration): The ellipsis does not end the
parameter declaration, because it might be a parameter pack. Parse
the ellipsis to indicate a parameter pack.
(cp_parser_initializer): Allow pack expansions.
(cp_parser_initializer_list): Allow ellipsis to create an
initializer expansion.
(cp_parser_base_clause): Allow ellipsis to create a base specifier
expansion.
(cp_parser_type_id_list): Allow ellipsis to create an exception
specifier expansion.
(cp_parser_attribute_list): Don't allow pack expansions.
(cp_parser_functional_cast): Allow pack expansions.
(cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
compute the length of a parameter pack.
(cp_parser_next_token_ends_template_argument_p): An ellipsis can
end a template argument.
* tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
CAST_EXPR.
From-SVN: r122788
|
|
destructors.
* doc/extend.texi: Document optional priority argument to
constructors and destructors.
* tree.c (init_priority_for_decl): Adjust GTY markers.
(init_ttree): Use priority-info hash functions for
init_priority_for_decl.
(tree_map_eq): Rename to ...
(tree_map_base_eq): ... this.
(tree_map_marked_p): Rename to ...
(tree_map_base_marked_p): ... this.
(tree_map_base_hash): New function.
(decl_init_priority_lookup): Rework.
(decl_fini_priority_lookup): New function.
(decl_priority_info): New function.
(decl_init_priority_insert): Use it.
(decl_fini_priority_insert): Likewise.
(decl_restrict_base_lookup): Adjust for refactoring of tree_map
hierarchy.
(decl_restrict_base_insert): Likewise.
(decl_debug_expr_insert): Likewise.
(decl_value_expr_lookup): Likewise.
(decl_value_expr_insert): Likewise.
* tree.h (priority_type): New type.
(decl_init_priority_lookup): Use priority_type.
(decl_fini_priority_lookup): New function.
(decl_init_priority_insert): Use priority_type.
(decl_fini_priority_insert): New function.
(DECL_HAS_INIT_PRIORITY): Tweak comments.
(DECL_INIT_PRIORITY): Likewise.
(SET_DECL_INIT_PRIORITY): Add comment.
(DECL_FINI_PRIORITY): New macro.
(SET_DECL_FINI_PRIORITY): Likewise.
(DEFAULT_INIT_PRIORITY): Document.
(MAX_INIT_PRIORITY): Likewise.
(MAX_RESERVED_INIT_PRIORITY): Likewise.
(tree_map_base): New type.
(tree_map_base_eq): New function.
(tree_map_base_hash): Likewise.
(tree_map_base_marked_p): Likewise.
(tree_map): Inherit from tree_map_base.
(tree_map_eq): Make it a macro.
(tree_map_marked_p): Likewise.
(tree_int_map): Inherit from tree_map_base.
(tree_int_map_eq): Make it a macro.
(tree_int_map_hash): Likewise.
(tree_int_map_marked_p): Likewise.
(tree_priority_map): New type.
(tree_priority_map_eq): New macro.
(tree_priority_map_hash): Likewise.
(tree_priority_map_marked_p): Likewise.
* varasm.c (emults_decl): Adjust for refactoring of tree_map
hierarchy.
(emutls_common_1): Likewise.
* lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise.
* tree-ssa-structalias.c (heapvar_lookup): Adjust for refactoring
of tree_map hierarchy.
* tree-cfg.c (move_stmt_r): Likewise.
(new_label_mapper): Likewise.
* c-tree.h (c_expand_body): Move to ...
* c-common.h (c_expand_body): ... here.
* c-decl.c (c_expand_body): Move to ...
* c-common.c (c_expand_body): ... here.
(c_common_attribute_table): Allow 1 argument for the constructor
and destructor attributes.
(get_priority): New function.
(handle_constructor_attribute): Set DECL_INIT_PRIORITY.
(handle_destructor_attribute): Set DECL_FINI_PRIORITY.
* cp-tree.h (static_ctors): Remove.
* cp-tree.h (static_dtors): Likewise.
* cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
refactoring of tree_map hierarchy.
(decl_shadowed_for_var_insert): Likewise.
* semantics.c (expand_body): Use c_expand_body.
(expand_or_defer_fn): Don't update static_ctors or static_dtors.
* decl2.c (static_ctors): Remove.
(static_dtors): Likewise.
(generate_ctor_or_dtor_function): Pass NULL_TREE to
objc_generate_static_init_call. Do not call static_[cd]tors.
(generate_ctor_and_dtor_functions_for_priority): Do not check for
static_[cd]tors.
(cp_write_global_declarations): Likewise.
* decl.c (annotate_value): Adjust for refactoring of tree_map
hierarchy.
* gcc.dg/initpri1.c: New test.
* gcc.dg/initpri2.c: Likewise.
* g++.dg/special/initpri1.C: New test.
* g++.dg/special/initpri2.C: Likewise.
* g++.dg/special/conpr-1.C: Use init_priority effective target.
* g++.dg/special/conpr-2.C: Likewise.
* g++.dg/special/conpr-3.C: Likewise.
* g++.dg/special/conpr-4.C: Likewise.
* g++.dg/special/initp1.C: Likewise.
* g++.dg/special/ecos.exp: Remove code to detect availability of
constructor priorities.
* lib/target-support.exp (target_init_priority): New function.
From-SVN: r122315
|
|
* class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
From-SVN: r121566
|
|
* cp-objcp-common.c (cp_expr_size): Return NULL in the case
size is undefined.
* builtins.c (fold_builtin_memory_op): Check that expr_size match.
* explow.c (expr_size, int_expr_size): Assert that size is non_NULL.
From-SVN: r119515
|
|
2006-11-21 Douglas Gregor <doug.gregor@gmail.com>
* cp-tree.def (STATIC_ASSERT): New.
* cp-objcp-common.c (cp_tree_size): Handle STATIC_ASSERT.
* error.c (dump_decl): Handle STATIC_ASSERT.
* cp-tree.h (STATIC_ASSERT_CONDITION): New.
(STATIC_ASSERT_MESSAGE): New.
(STATIC_ASSERT_SOURCE_LOCATION): New.
(struct tree_static_assert): New.
(enum cp_tree_node_structure_enum): Add TS_CP_STATIC_ASSERT.
(union lang_tree_node): Add static_assertion.
(finish_static_assert): Declare.
* cxx-pretty-print.c (pp_cxx_statement): Handle STATIC_ASSERT.
(pp_cxx_declaration): Handle STATIC_ASSERT.
* pt.c (instantiate_class_template): Handle
STATIC_ASSERT members.
(tsubst_expr): Handle STATIC_ASSERT statements.
* semantics.c (finish_static_assert): New.
* lex.c (D_CPP0X): New.
(reswords): Add static_assert keyword.
(init_reswords): If not flag_cpp0x, mask out C++0x keywords.
* parser.c (cp_parser_block_declaration): Parse static
assertions.
(cp_parser_static_assert): New.
(cp_parser_member_declaration): Parse static assertions.
From-SVN: r119066
|
|
PR c++/28991
* cp-objcp-common.c (cxx_staticp): New function.
* cp-objcp-common.h (LANG_HOOOKS_STATICP): Use it.
* cp-tree.h (cxx_staticp): New function.
PR c++/289991
* g++.dg/init/static3.C: New test.
From-SVN: r116838
|
|
program)
2006-08-02 Richard Guenther <rguenther@suse.de>
PR c++/28479
Revert
2006-07-05 Richard Guenther <rguenther@suse.de>
Andrew Pinski <pinskia@gcc.gnu.org>
PR c++/27084
* cp-objcp-common.c (cxx_types_compatible_p): Ignore
top level qualifiers for pointer type comparisons.
* g++.dg/tree-ssa/copyprop-1.C: XFAIL.
From-SVN: r115887
|
|
type conversion)
2006-07-05 Richard Guenther <rguenther@suse.de>
Andrew Pinski <pinskia@gcc.gnu.org>
PR c++/27084
* cp-objcp-common.c (cxx_types_compatible_p): Ignore
top level qualifiers for pointer type comparisons.
* g++.dg/tree-ssa/copyprop-1.C: New testcase.
Co-Authored-By: Andrew Pinski <pinskia@gcc.gnu.org>
From-SVN: r115200
|
|
From-SVN: r114428
|
|
* call.c (alloc_conversion): Use cast when converting from
void *.
(alloc_conversions): Likewise.
(add_candidate): Likewise.
(print_z_candidates): Likewise.
(add_warning): Likewise.
* pt.c (retrieve_local_specialization): Likewise.
(process_partial_specialization): Likewise.
(mangle_class_name_for_template): Likewise.
(tsubst_template_args): Likewise.
* typeck2.c (pat_calc_hash): Likewise.
(pat_compare): Likewise.
(abstract_virtuals_error): Likewise.
* class.c (method_name_cmp): Likewise.
(resort_method_name_cmp): Likewise.
(get_vfield_name): Likewise.
* decl2.c (generate_ctor_and_dtor_functions_for_priority):
Likewise.
* lex.c (init_reswords): Likewise.
* rtti.c (create_pseudo_type_info): Likewise.
* search.c (dfs_lookup_base): Likewise.
(dfs_dcast_hint_pre): Likewise.
(dfs_dcast_hint_post): Likewise.
* tree.c (hash_tree_cons): Likewise.
* repo.c (extract_string): Likewise.
(afgets): Likewise.
* cp-objcp-common.c (decl_shadowed_for_var_lookup): Likewise.
* g++spec.c (lang_specific_driver): Likewise.
From-SVN: r110366
|
|
* decl2.c (get_priority_info): Use XNEW, not xmalloc.
* decl.c (push_switch): Likewise.
* lex.c (handle_pragma_implementation): Likewise.
* cp-objcp-common.c (decl_shadowed_for_var_insert): Use GGC_NEW,
not ggc_alloc.
(cxx_initialize_diagnostics): Use XNEW, not xmalloc.
* class.c (init_class_processing): Use XNEWVEC, not xmalloc.
* g++spec.c (lang_specific_driver): Likewise.
* mangle.c (save_partially_mangled_name): Likewise.
* parser.c (cp_lexer_new_main): Use GGC_NEWVEC, not ggc_alloc.
(cp_parser_template_argument_list): Use XNEWVEC, nto xmalloc.
(cp_parser_sizeof_operand): Likewise.
* repo.c (open_repo_file, open_repo_file): Likewise.
From-SVN: r107884
|
|
2005-07-09 Andrew Pinski <pinskia@physics.uc.edu>
* cp-lang.c (shadowed_var_for_decl, decl_shadowed_for_var_lookup,
decl_shadowed_for_var_insert): Move over to cp-objcp-common.c.
(cp_init_ts): Call init_shadowed_var_for_decl.
Remove include of gt-cp-cp-lang.h.
* cp-objcp-common.c (shadowed_var_for_decl,
decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Moved from
cp-lang.c.
(init_shadowed_var_for_decl): New function to initialize
shadowed_var_for_decl.
Include gt-cp-cp-objcp-common.h.
* Make-lang.in (gt-cp-lang.h): Remove.
(gt-cp-cp-objcp-common.h): Add.
(cp/cp-lang.o): Remove dependancy on gt-cp-lang.h.
(cp/cp-objcp-common.o): Add dependancy on gt-cp-cp-objcp-common.h.
* config-lang.in (gtfiles): Remove cp-lang.c and Add cp-objcp-common.c.
* cp-tree (init_shadowed_var_for_decl): Add prototype.
2005-07-09 Andrew Pinski <pinskia@physics.uc.edu>
* config-lang.in (gtfiles): Add cp-objcp-common.c.
* objcp-lang.c (objcxx_init_ts): New function.
(LANG_HOOKS_INIT_TS): Define.
From-SVN: r101830
|
|
From-SVN: r101312
|
|
From-SVN: r100965
|
|
From-SVN: r100952
|
|
PR c++/18793
* cp-objcp-common.c (cp_expr_size): Loosen assertion.
PR c++/18793
* g++.dg/init/aggr3.C: New test.
From-SVN: r92156
|
|
ChangeLog:
PR tree-optimization/18184
* c-typeck.c (comptypes): Do not treat pointers of different
modes or alias-all flags as equivalent.
* tree-ssa.c (tree_ssa_useless_type_conversion_1): Likewise.
cp/ChangeLog:
PR tree-optimization/18184
* cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers
of different modes or alias-all flags as equivalent.
* typeck.c (comptypes): Likewise.
From-SVN: r90078
|
|
[gcc/ChangeLog]
2004-11-02 Ziemowit Laski <zlaski@apple.com>
* c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Remove.
(c_types_compatible_p): Move function definition...
* c-objc-common.c (c_types_compatible_p): ...here.
* c-objc-common.h (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from
c-lang.c.
[gcc/cp/ChangeLog]
2004-11-02 Ziemowit Laski <zlaski@apple.com>
* cp-lang.c (cxx_types_compatible_p): Remove prototype and definition.
(LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h.
* cp-objcp-common.c (cxx_types_compatible_p): Moved definition here
from cp-lang.c.
* cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here
from cp-lang.c.
(LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c.
From-SVN: r89997
|
|
2004-08-31 Ziemowit Laski <zlaski@apple.com>
* Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
(cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
(cp/cp-decl.c): Do not depend on gtype-cp.h.
(cp/cp-objcp-common.o): New target.
* cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
(cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
respectively.
(LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
hooks to cp-objcp-common.h.
(finish_file): New function.
* cp-objcp-common.c: New file.
* cp-objcp-common.h: New file.
* cp-tree.h (cp_finish_file): New prototype.
* decl.c: Do not include gtype-cp.h.
* decl2.c (finish_file): Rename to cp_finish_file.
From-SVN: r86837
|