Regarding tree traversal

Mike Stump mrs@apple.com
Wed Feb 7 23:01:00 GMT 2007


On Feb 7, 2007, at 1:05 PM, Prabhanjan Kambadur wrote:
> I am new to this list, so please excuse any obvious mistakes. I am
> trying to check if two types are equal or one is derived from the
> other within the compiler. One of the types is a struct that is
> defined under the std namescope. How do I search for a "node" that is
> a TYPE_DECL of the structure that I want? I would like to search for
> the TYPE_DECL of "struct foo" in the tree std_node.

Just to be clear, given "std" and given "foo" you want to find  
std::foo, right?  That's the question I previously answered.

Or, is your question, given the shape expressed by tree bar (a  
TYPE_DECL), find a "foo" with the same shape?

The second question is answered by looping over all the members of  
std, and checking each one for the right shape.



More information about the Gcc mailing list