This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Additional tree node questions.


Ian Lance Taylor wrote:
> Brendon Costa <bcosta@avdat.com.au> writes:
> 
>> For each FUNCTION_DECL node I find, I want to determine what its
>> exception specification list is. I.e. the throws() statement in its
>> prototype.
> 
> Look at TYPE_RAISES_EXCEPTIONS (FNDECL).
> 
> Ian

This macro does not seem to work. Either that or i am doing something wrong.

I have some code that looks a little like:


temp_tree = TYPE_RAISES_EXCEPTIONS(node);
if (temp_tree)
{
   fprintf(stderr, "Has an exception spec.\n");
   for (list = node; list; list = TREE_CHAIN(list))
   {
      /* Get the type for the specification. */
      temp_tree = TREE_VALUE(list);

...

If i use the test code below:

void Function1() throw()
{
}

void Function2() throw(float)
{
	throw 1.0f;
}

int main()
{
   Function1();
   Function2();
   return 0;
}

I never see the print statement. I am doing this with the FUNCTION_DECL
nodes that pass through the: gimplify_function_tree() function.

Is there something incorrect about my usage of this macro?

I am using gcc-4.0.1

Thanks,
Brendon.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]