c-ada-spec.h (cpp_operation): Add IS_TRIVIAL.

c-family/
	* c-ada-spec.h (cpp_operation): Add IS_TRIVIAL.
	(dump_ada_specs): Adjust prototype of second callback.
	* c-ada-spec.c (cpp_check): New global variable.
	(dump_ada_nodes): Remove cpp_check parameter and do not pass it down.
	(print_generic_ada_decl): Likewise.
	(has_static_fields): Change return type to bool and add guard.
	(has_nontrivial_methods): New predicate.
	(is_tagged_type): Change return type to bool.
	(separate_class_package): Call has_nontrivial_methods.
	(pp_ada_tree_identifier): Minor tweaks.
	(dump_ada_function_declaration): Adjust calls to dump_generic_ada_node.
	(dump_ada_array_domains): Likewise.
	(dump_ada_array_type): Likewise.
	(dump_template_types): Remove cpp_check parameter and do not pass it to
	dump_generic_ada_node.
	(dump_ada_template): Likewise.
	(dump_generic_ada_node): Remove cpp_check parameter and do not pass it
	recursively.
	(print_ada_methods): Change return type to integer.  Remove cpp_check
	parameter and do not pass it down.
	(dump_nested_types): Remove cpp_check parameter and do not pass it to
	dump_generic_ada_node.
	(print_ada_declaration): Likewise.  Test RECORD_OR_UNION_TYPE_P before
	accessing methods.
	(print_ada_struct_decl): Remove cpp_check parameter and do not pass it
	down.  Use has_nontrivial_methods to recognize C++ classes.  Use return
	value of print_ada_methods.
	(dump_ads): Rename cpp_check parameter to check and adjust prototype.
	Set cpp_check to it before invoking dump_ada_nodes.
	(dump_ada_specs): Likewise.
cp/
	* decl2.c (cpp_check): Change type of first parameter and deal with
	IS_TRIVIAL.

From-SVN: r204344
This commit is contained in:
Eric Botcazou 2013-11-04 07:24:44 +00:00 committed by Eric Botcazou
parent 846276fae1
commit 94159ecf92
5 changed files with 246 additions and 226 deletions

View File

@ -1,3 +1,36 @@
2013-11-04 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.h (cpp_operation): Add IS_TRIVIAL.
(dump_ada_specs): Adjust prototype of second callback.
* c-ada-spec.c (cpp_check): New global variable.
(dump_ada_nodes): Remove cpp_check parameter and do not pass it down.
(print_generic_ada_decl): Likewise.
(has_static_fields): Change return type to bool and add guard.
(has_nontrivial_methods): New predicate.
(is_tagged_type): Change return type to bool.
(separate_class_package): Call has_nontrivial_methods.
(pp_ada_tree_identifier): Minor tweaks.
(dump_ada_function_declaration): Adjust calls to dump_generic_ada_node.
(dump_ada_array_domains): Likewise.
(dump_ada_array_type): Likewise.
(dump_template_types): Remove cpp_check parameter and do not pass it to
dump_generic_ada_node.
(dump_ada_template): Likewise.
(dump_generic_ada_node): Remove cpp_check parameter and do not pass it
recursively.
(print_ada_methods): Change return type to integer. Remove cpp_check
parameter and do not pass it down.
(dump_nested_types): Remove cpp_check parameter and do not pass it to
dump_generic_ada_node.
(print_ada_declaration): Likewise. Test RECORD_OR_UNION_TYPE_P before
accessing methods.
(print_ada_struct_decl): Remove cpp_check parameter and do not pass it
down. Use has_nontrivial_methods to recognize C++ classes. Use return
value of print_ada_methods.
(dump_ads): Rename cpp_check parameter to check and adjust prototype.
Set cpp_check to it before invoking dump_ada_nodes.
(dump_ada_specs): Likewise.
2013-11-03 Marek Polacek <polacek@redhat.com>
* c-ubsan.c: Don't include hash-table.h.

File diff suppressed because it is too large Load Diff

View File

@ -29,13 +29,14 @@ typedef enum {
IS_CONSTRUCTOR,
IS_DESTRUCTOR,
IS_COPY_CONSTRUCTOR,
IS_TEMPLATE
IS_TEMPLATE,
IS_TRIVIAL
} cpp_operation;
extern location_t decl_sloc (const_tree, bool);
extern void collect_ada_nodes (tree, const char *);
extern void collect_source_ref (const char *);
extern void dump_ada_specs (void (*)(const char *),
int (*)(tree, cpp_operation));
int (*)(const_tree, cpp_operation));
#endif /* ! C_ADA_SPEC_H */

View File

@ -1,3 +1,8 @@
2013-11-04 Eric Botcazou <ebotcazou@adacore.com>
* decl2.c (cpp_check): Change type of first parameter and deal with
IS_TRIVIAL.
2013-11-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/38313

View File

@ -3789,7 +3789,7 @@ build_java_method_aliases (struct pointer_set_t *candidates)
/* Return C++ property of T, based on given operation OP. */
static int
cpp_check (tree t, cpp_operation op)
cpp_check (const_tree t, cpp_operation op)
{
switch (op)
{
@ -3803,6 +3803,8 @@ cpp_check (tree t, cpp_operation op)
return DECL_COPY_CONSTRUCTOR_P (t);
case IS_TEMPLATE:
return TREE_CODE (t) == TEMPLATE_DECL;
case IS_TRIVIAL:
return trivial_type_p (t);
default:
return 0;
}