Commit 095d8d4b by Eric Botcazou Committed by Eric Botcazou

c-ada-spec.c (dump_ada_import): Use boolean and fix formatting.

	* c-ada-spec.c (dump_ada_import): Use boolean and fix formatting.
	(is_char_array): Fix formatting.
	(dump_template_types): Likewise.
	(dump_generic_ada_node): Rename into...
	(dump_ada_node): ...this.
	<POINTER_TYPE>: Remove superfluous space.  Use generic address for
	incomplete structures and not for empty structures.  Do not use it
	when forward declarations are needed.
	(dump_forward_type): New function.
	(dump_nested_types): Remove FORWARD parameter.  Do not consider
	TREE_VISITED and do not generate a forward declaration.  Only dump
	original nested types for nested declaration.
	(dump_nested_type) <POINTER_TYPE>: Call dump_forward_type.
	<ARRAY_TYPE>: Likewise if the component type is an anonymous pointer.
	<RECORD_TYPE>: Do not consider TREE_VISITED.
	(dump_ada_declaration): Use booleans and fix formatting throughout.
	<TYPE_DECL>: Skip incomplete structures and not empty structures.
	Call dump_forward_type instead of dump_nested_types for a typedef.
	Remove superfluous check and adjust call to dump_nested_types.
	<POINTER_TYPE>: Call dump_forward_type and fall through.
	(dump_ada_struct_decl): Rename into...
	(dump_ada_structure): ...this.  Do not special-case empty structures.

From-SVN: r258062
parent 9348eb67
2018-02-28 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (dump_ada_import): Use boolean and fix formatting.
(is_char_array): Fix formatting.
(dump_template_types): Likewise.
(dump_generic_ada_node): Rename into...
(dump_ada_node): ...this.
<POINTER_TYPE>: Remove superfluous space. Use generic address for
incomplete structures and not for empty structures. Do not use it
when forward declarations are needed.
(dump_forward_type): New function.
(dump_nested_types): Remove FORWARD parameter. Do not consider
TREE_VISITED and do not generate a forward declaration. Only dump
original nested types for nested declaration.
(dump_nested_type) <POINTER_TYPE>: Call dump_forward_type.
<ARRAY_TYPE>: Likewise if the component type is an anonymous pointer.
<RECORD_TYPE>: Do not consider TREE_VISITED.
(dump_ada_declaration): Use booleans and fix formatting throughout.
<TYPE_DECL>: Skip incomplete structures and not empty structures.
Call dump_forward_type instead of dump_nested_types for a typedef.
Remove superfluous check and adjust call to dump_nested_types.
<POINTER_TYPE>: Call dump_forward_type and fall through.
(dump_ada_struct_decl): Rename into...
(dump_ada_structure): ...this. Do not special-case empty structures.
2018-02-27 Martin Sebor <msebor@redhat.com>
PR c++/83871
......
2018-02-28 Eric Botcazou <ebotcazou@adacore.com>
* c-c++-common/dump-ada-spec-8.c: New test.
* c-c++-common/dump-ada-spec-9.c: Likewise.
* c-c++-common/dump-ada-spec-10.c: Likewise.
2018-02-28 Richard Biener <rguenther@suse.de>
PR middle-end/84607
......
/* { dg-do compile } */
/* { dg-options "-fdump-ada-spec" } */
typedef struct T *My_Ptr1;
int foo1 (My_Ptr1);
typedef struct T *My_Ptr2;
int foo2 (My_Ptr2);
struct T { int i; };
/* { dg-final { scan-ada-spec-not "System.Address" } } */
/* { dg-final { cleanup-ada-spec } } */
/* { dg-do compile } */
/* { dg-options "-fdump-ada-spec -w" } */
typedef struct T {} My_T;
int foo (My_T *t);
struct S1;
struct S2 { struct S1 *s; };
struct S1 {};
/* { dg-final { scan-ada-spec-not "System.Address" } } */
/* { dg-final { cleanup-ada-spec } } */
/* { dg-do compile } */
/* { dg-options "-fdump-ada-spec" } */
typedef struct T My_T;
int foo1 (My_T *);
int foo2 (My_T *);
struct T { int i; };
/* { dg-final { scan-ada-spec-not "System.Address" } } */
/* { dg-final { cleanup-ada-spec } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment