This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [pph] Various Tree Fields (issue4550064)
- From: Diego Novillo <dnovillo at google dot com>
- To: Lawrence Crowl <crowl at google dot com>
- Cc: reply at codereview dot appspotmail dot com, gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 May 2011 17:55:42 -0400
- Subject: Re: [pph] Various Tree Fields (issue4550064)
- References: <20110520210901.018D322266A@jade.mtv.corp.google.com>
On Fri, May 20, 2011 at 17:09, Lawrence Crowl <crowl@google.com> wrote:
> Split C++ test x1funcstatic.cc into a C test and a C++ test.
> Stream out and in various C++ tree members.
>
> Index: gcc/testsuite/ChangeLog.pph
>
> 2011-05-20 ÂLawrence Crowl Â<crowl@google.com>
>
> Â Â Â Â* x1funcstatic.h: Rename to c1funcstatic.h, as contents are C only.
> Â Â Â Â* x1funcstatic.c: Use c1funcstatic.h instead of x1funcstatic.h.
> Â Â Â Â* c1funcstatic.c: Add to test C functionality.
>
> Index: gcc/cp/ChangeLog.pph
>
> 2011-05-20 ÂLawrence Crowl <crowl@google.com>
>
> Â Â Â Â* pph-streamer-in.c (pph_stream_read_qual_use_vec): Add.
> Â Â Â Â(pph_stream_read_tree_vec_none): Add.
> Â Â Â Â(pph_stream_read_tree): Add read of various C++ fields.
> Â Â Â Â* pph-streamer-out.c (pph_stream_write_qual_use_vec): Add.
> Â Â Â Â(pph_stream_write_tree_vec_none): Add.
> Â Â Â Â(pph_stream_write_tree): Add write of various C++ fields.
Thanks.
As we chatted off list, you can now get rid off of the TREE_BINFO
handling code. That's already handled in the gimple streamer.
> + Â Â}
> + Âelse if (TREE_CODE (expr) == TREE_LIST)
> + Â Â; /* FIXME pph: already handled? Â*/
Yes, TREE_LIST is handled already.
> + Âelse if (flag_pph_debug >= 2)
> + Â Âfprintf (pph_logfile, "PPH: unimplemented read of %s\n",
> + Â Â Â Â Â Â tree_code_name[TREE_CODE (expr)]);
This will print everything. This hook is called from tree_on every
node, regardless of whether it was handled or not.
> @@ -788,6 +825,9 @@ pph_stream_write_tree (struct output_blo
> Â if (DECL_P (expr))
> Â Â {
> Â Â Â pph_output_tree_or_ref_1 (stream, DECL_INITIAL (expr), ref_p, 3);
> + Â Â Â/* FIXME pph:
> + Â Â Âpph_output_tree_or_ref_1 (stream, DECL_NAME (expr), ref_p, 3);
> + Â Â Â*/
DECL_NAME is already handled in the gimple streamer.
>
> Â Â Â if (TREE_CODE (expr) == FUNCTION_DECL
> Â Â Â Â Â|| TREE_CODE (expr) == NAMESPACE_DECL
> @@ -828,6 +868,57 @@ pph_stream_write_tree (struct output_blo
> Â Â Â Â Â pph_output_tree_or_ref_1 (stream, TYPE_BINFO (expr), ref_p, 3);
> Â Â Â Â }
> Â Â }
> + Âelse if (TREE_CODE (expr) == OVERLOAD)
> + Â Â{
> + Â Â Âpph_output_tree_or_ref_1 (stream, OVL_CURRENT (expr), ref_p, 3);
> + Â Â}
> + Âelse if (TREE_CODE (expr) == IDENTIFIER_NODE)
> + Â Â{
> + Â Â Âstruct lang_identifier *id = LANG_IDENTIFIER_CAST(expr);
> + Â Â Âpph_output_tree_or_ref_1 (stream, TREE_TYPE (expr), ref_p, 3);
> + Â Â Âpph_output_string_with_length (stream, IDENTIFIER_POINTER (expr),
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â IDENTIFIER_LENGTH (expr));
> + Â Â Âpph_stream_write_cxx_binding (stream, id->namespace_bindings, ref_p);
> + Â Â Âpph_stream_write_cxx_binding (stream, id->bindings, ref_p);
> + Â Â Âpph_output_tree_or_ref_1 (stream, id->class_template_info, ref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, id->label_value, ref_p, 3);
factor out? (similarly on the reading side.
> + Â Â}
> + Âelse if (TREE_CODE (expr) == BASELINK)
> + Â Â{
> + Â Â Âpph_output_tree_or_ref_1 (stream, BASELINK_BINFO (expr), ref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, BASELINK_FUNCTIONS (expr), ref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, BASELINK_ACCESS_BINFO (expr), ref_p, 3);
> + Â Â}
Likewise.
> + Âelse if (TREE_CODE (expr) == TREE_BINFO)
> + Â Â{
> + Â Â Âpph_output_tree_or_ref_1 (stream, BINFO_OFFSET (expr), ref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, BINFO_VTABLE (expr), ref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, BINFO_VIRTUALS (expr), ref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, BINFO_VPTR_FIELD (expr), ref_p, 3);
> + Â Â Âpph_stream_write_tree_vec (stream, BINFO_BASE_ACCESSES (expr), ref_p);
> + Â Â Âpph_output_tree_or_ref_1 (stream, BINFO_INHERITANCE_CHAIN (expr),
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, BINFO_SUBVTT_INDEX (expr), ref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, BINFO_VPTR_INDEX (expr), ref_p, 3);
> + Â Â Âpph_stream_write_tree_vec_none (stream, BINFO_BASE_BINFOS (expr), ref_p);
> + Â Â}
> + Âelse if (TREE_CODE (expr) == TEMPLATE_DECL)
> + Â Â{
> + Â Â Âpph_output_tree_or_ref_1 (stream, DECL_TEMPLATE_RESULT (expr), ref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, DECL_TEMPLATE_PARMS (expr), ref_p, 3);
> + Â Â Âpph_output_tree_or_ref_1 (stream, DECL_CONTEXT (expr), ref_p, 3);
> + Â Â Â/* FIXME pph: what of bit DECL_MEMBER_TEMPLATE_P (expr) */
Just write it out as an unsigned char.
> + Â Â}
> + Âelse if (TREE_CODE (expr) == TEMPLATE_INFO)
> + Â Â{
> + Â Â Âpph_stream_write_qual_use_vec (stream,
> + Â Â Â Â ÂTI_TYPEDEFS_NEEDING_ACCESS_CHECKING (expr), ref_p);
> + Â Â}
> + Âelse if (TREE_CODE (expr) == TREE_LIST)
> + Â Â; /* FIXME pph: already handled? Â*/
Yes, already handled.
Diego.