Next:Temporaries, Previous:GIMPLE instruction set, Up:GIMPLE [Contents][Index]
Other exception handling constructs are represented usingGIMPLE_TRY_CATCH.GIMPLE_TRY_CATCH has two operands. Thefirst operand is a sequence of statements to execute. If executingthese statements does not throw an exception, then the second operandis ignored. Otherwise, if an exception is thrown, then the secondoperand of theGIMPLE_TRY_CATCH is checked. The secondoperand may have the following forms:
GIMPLE_CATCH statements. EachGIMPLE_CATCH has a list of applicable exception types andhandler code. If the thrown exception matches one of the caughttypes, the associated handler code is executed. If the handlercode falls off the bottom, execution continues after the originalGIMPLE_TRY_CATCH.GIMPLE_EH_FILTER statement. This has a list ofpermitted exception types, and code to handle a match failure. If thethrown exception does not match one of the allowed types, theassociated match failure code is executed. If the thrown exceptiondoes match, it continues unwinding the stack looking for the nexthandler.Currently throwing an exception is not directly represented inGIMPLE, since it is implemented by calling a function. At somepoint in the future we will want to add some way to express thatthe call will throw an exception of a known type.
Just before running the optimizers, the compiler lowers thehigh-level EH constructs above into a set of ‘goto’s, magiclabels, and EH regions. Continuing to unwind at the end of acleanup is represented with aGIMPLE_RESX.
Next:Temporaries, Previous:GIMPLE instruction set, Up:GIMPLE [Contents][Index]