Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(33)

Issue 4550121: [pph] Stream TREE_TYPE for identifier node (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by Gabriel Charette
Modified:
13 years, 8 months ago
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn://gcc.gnu.org/svn/gcc/branches/pph/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -2 lines) Patch
M gcc/cp/pph-streamer-in.c View 1 chunk +1 line, -0 lines 0 comments Download
M gcc/cp/pph-streamer-out.c View 1 chunk +1 line, -0 lines 0 comments Download
M gcc/testsuite/g++.dg/pph/x1functions.cc View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 7
Gabriel Charette
We need to stream TREE_TYPE for identifier node. This fixes some ICEs, but introduces some ...
13 years, 10 months ago (2011-06-07 18:44:35 UTC) #1
stevenb.gcc
On Tue, Jun 7, 2011 at 8:44 PM, Gabriel Charette <gchare@google.com> wrote: > We need ...
13 years, 10 months ago (2011-06-07 21:12:31 UTC) #2
Diego Novillo
On Tue, Jun 7, 2011 at 14:12, Steven Bosscher <stevenb.gcc@gmail.com> wrote: > On Tue, Jun ...
13 years, 10 months ago (2011-06-07 21:50:06 UTC) #3
stevenb.gcc
On Tue, Jun 7, 2011 at 11:50 PM, Diego Novillo <dnovillo@google.com> wrote: > On Tue, ...
13 years, 10 months ago (2011-06-08 10:38:25 UTC) #4
Diego Novillo
On Wed, Jun 8, 2011 at 03:38, Steven Bosscher <stevenb.gcc@gmail.com> wrote: > On Tue, Jun ...
13 years, 10 months ago (2011-06-08 14:12:29 UTC) #5
stevenb.gcc
On Wed, Jun 8, 2011 at 4:12 PM, Diego Novillo wrote: >>>> That seems unlikely, ...
13 years, 10 months ago (2011-06-08 19:31:57 UTC) #6
jason_redhat.com
13 years, 10 months ago (2011-06-09 02:29:08 UTC) #7
On 06/08/2011 03:31 PM, Steven Bosscher wrote:
> The rest are all in cp/.  It looks like g++ uses TREE_TYPE as a cache
> for name lookups. Perhaps Jason can comment. Obviously not a front end
> I know very well, but let's look at them one at a time:
>
> cp/cp-tree.h:  (DECL_CONV_FN_P (FN) ? TREE_TYPE (DECL_NAME (FN)) : NULL_TREE)
>
> Apparently g++ puts the type of an operator in TREE_TYPE of an
> IDENTIFIER_NODE. This should probably be using
> REAL_IDENTIFIER_TYPE_VALUE() instead of TREE_TYPE().

Yes, this is to associate the name of a type conversion operator with 
the type it converts to.  Using a different macro would be fine.

> cp/decl.c:        if (TREE_TYPE (DECL_NAME (decl))&&  TREE_TYPE (decl) !=
type)
>
> This is in a warning for a type declaration shadowing a local or class
> scope.  Should use identifier_type_value (or
> REAL_IDENTIFIER_TYPE_VALUE but I think that's supposed to be used
> directly only in name-lookup.c??)

Sure, identifier_type_value would work.  But that code looks bitrotted; 
type is always equal to TREE_TYPE (decl).  I'd be inclined to try 
removing it and seeing if anything breaks.

> cp/decl2.c:       tree underlying_type = TREE_TYPE (DECL_NAME (decl));
> cp/decl2.c:         (decl, type_visibility (TREE_TYPE (DECL_NAME (decl))));
> cp/decl2.c:&&  CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl)))
> cp/decl2.c:&&  !CLASSTYPE_VISIBILITY_SPECIFIED (TREE_TYPE
> (DECL_NAME (decl))))
> cp/decl2.c:      tree type = TREE_TYPE (DECL_NAME (decl));
> cp/repo.c:      type = TREE_TYPE (DECL_NAME (decl));
> cp/rtti.c:  tree type = TREE_TYPE (DECL_NAME (decl));
>
> All of these are covered by a check on DECL_TINFO_P. I am not sure
> what that means but probably these should also be using
> identifier_type_value or REAL_IDENTIFIER_TYPE_VALUE instead of
> TREE_TYPE. Jason?

This is a way of finding the class a type_info node/vtable pertains to. 
  Using a different lookup strategy would be fine.

Jason
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b