#include "AST.h" #include "CtType.h" #include "LocalVars.h" #include "decls.h" void CatchNode::emitCatchTable( ostream &os ) const { ClassDecl &decl = static_cast< ClassDecl & >(*param()->dtype()->decl()); assert( decl.category() == Decl::Class ); os << "(const struct class_header *)" "( &" << decl.cDescriptorName() << " )" ",\n"; } const string CatchNode::emitUse( LocalVars &context, const ObjectNode & ) const { // We use "param()->dtype()" instead of "caught.type()" because // the former is const while the later is not. const CtType &type = param()->dtype()->cType(); context.depend( type ); // side-effect free return "*((" + type + " *) &local_exnstate.value)"; }