public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* tree dump system and scopes
@ 2004-09-15 12:31 Tiago Stein
  2004-09-16 20:52 ` James E Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Tiago Stein @ 2004-09-15 12:31 UTC (permalink / raw)
  To: gcc



Hello, I am writting this mail because I am developing a tool with gcc on
my university research (some code transformations stuff). I already
introduced some modifications in the tree dump system of g++ (the one
enable by -fdump-tree-inlined) to get some informations I need, but now I
need to be able to identify when a class (record) is inside any special
scope. I get the scope statement when the class is inside a namespace, but
I do not get any information when the class is nested to other class.  In
other words, if I have class A, nested to class B, I would like to have
the info that B name is A::B  or that it is inside A class somehow.


Can anyone give me pointer where I should look in code in order to modify
the dump system to give me these informations.

Thanks for any help.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tree dump system and scopes
  2004-09-15 12:31 tree dump system and scopes Tiago Stein
@ 2004-09-16 20:52 ` James E Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: James E Wilson @ 2004-09-16 20:52 UTC (permalink / raw)
  To: Tiago Stein; +Cc: gcc

Tiago Stein wrote:
> need to be able to identify when a class (record) is inside any special
> scope.

If you have trees, then the TYPE_CONTEXT field of a type, and the 
DECL_CONTEXT field of a decl, contains a pointer to the containing 
object or type.

There are some helper functions that you might find useful.  See for 
instance get_containing_scope, decl_function_context, and decl_type_context.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-16 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-15 12:31 tree dump system and scopes Tiago Stein
2004-09-16 20:52 ` James E Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).