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]

Understanding some EXPR nodes.


Hi All,

I am trying to understand certain EXPR nodes, when they are generated
and how code generated from them behaves in the resulting program.

The nodes that have me a little confused are:

TRY_CATCH_EXPR
TRY_FINALLY_EXPR
MUST_NOT_THROW_EXPR
EH_FILTER_EXPR

Note: I have read the GCC Internals documentation and the documentation
in the appropriate .def files for these tree codes. It does not mention
the information I am after.


TRY_CATCH_EXPR/TRY_FINALLY_EXPR
When code generated from these nodes encounter an exception while
processing code from operand 0 is there an implicit rethrow of that
exception at the end of the block of code given by operand 1 or does it
"sink" the exception and only rethrow it if the user specifically
requests it (In C++ anyway)?

In what situations are these nodes generated?


MUST_NOT_THROW_EXPR
What sort of code produces one of these nodes? They do not seem to be
used for the throw() specifiers for a function (At least in C++) as i
would have expected.

EH_FILTER_EXPR
In what situations are these nodes generated? I assume that the code
that these filters applies to is external to the node and if an
exception occurs in this external code that does not match any of the
types in the EH_FILTER_TYPES list (Do they have to be exact matches/how
is type matching done here) then it calls the EH_FILTER_FAILURE which
could be for example a call to terminate()?

How does the EH_FILTER_MUST_NOT_THROW() macro work? If it returns true
then the filter allows NO exceptions and if false then allows only
exceptions of type that are in this list? Is it possible for the
EH_FILTER_TYPES list to be empty and EH_FILTER_MUST_NOT_THROW() to
return false?



Thanks for any information on these questions. It will help me a great deal.
Brendon.


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