This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [gcc libcc1] build_qualified_type for self-referencing/incomplete types
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Phil Muldoon <pmuldoon at redhat dot com>, Tom Tromey <tom at tromey dot com>, gdb at sourceware dot org
- Date: Sat, 18 Apr 2015 12:19:53 +0200
- Subject: Re: [gcc libcc1] build_qualified_type for self-referencing/incomplete types
- Authentication-results: sourceware.org; auth=none
- References: <20150410123145 dot GA18073 at host1 dot jankratochvil dot net> <20150414060905 dot GA22747 at host1 dot jankratochvil dot net> <20150417152213 dot GA2589 at host1 dot jankratochvil dot net>
On Fri, 17 Apr 2015 17:22:13 +0200, Jan Kratochvil wrote:
> How to get 'volatile struct sv' GCC 'tree' type for:
> volatile struct sv { volatile struct sv *p; };
I have found out how it can work, even with no change on the GCC side:
Instead of current:
plugin_build_record_type:
record_type = make_node (RECORD_TYPE)
plugin_build_add_field:
add fields to record_type... But there is no qualified_record_type here!
plugin_finish_record_or_union:
TYPE_SIZE (record_type) etc. ... to finish the type
plugin_build_qualified_type:
qualified_record_type = build_qualified_type (record_type, ...)
one can do instead:
plugin_build_record_type:
record_type = make_node (RECORD_TYPE)
plugin_build_qualified_type:
qualified_record_type = build_qualified_type (record_type, ...)
plugin_build_add_field:
add fields to qualified_record_type
plugin_finish_record_or_union:
TYPE_SIZE (qualified_record_type) etc. ... to finish the type
And one forgets about the unfinished record_type.
For a different cv-quals of the same record type one builds a new cv-qualified
record from scratch.
Jan