Changeset 550446f
- Timestamp:
- Jan 8, 2025, 4:30:50 PM (8 months ago)
- Branches:
- master
- Children:
- 454aab2, 5a894e12
- Parents:
- f32448e
- Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cpp
rf32448e r550446f 1130 1130 } 1131 1131 1132 void CodeGenerator::postvisit( ast::TryStmt const * stmt ) { 1133 assertf( !options.genC, "TryStmt should not reach code generation." ); 1134 1135 output << "try "; 1136 stmt->body->accept( *visitor ); 1137 for ( ast::ptr<ast::CatchClause> const & handler : stmt->handlers ) { 1138 handler->accept( *visitor ); 1139 } 1140 if ( stmt->finally ) stmt->finally->accept( *visitor ); 1141 } 1142 1132 1143 void CodeGenerator::postvisit( ast::CatchClause const * stmt ) { 1133 1144 assertf( !options.genC, "CatchClause should not reach code generation." ); 1134 1145 1135 output << ((stmt->kind == ast::Terminate) ? " catch" : "catchResume");1146 output << ((stmt->kind == ast::Terminate) ? " catch " : " catchResume "); 1136 1147 output << "( "; 1137 1148 stmt->decl->accept( *visitor ); … … 1142 1153 output << " ) "; 1143 1154 stmt->body->accept( *visitor ); 1155 } 1156 1157 void CodeGenerator::postvisit( ast::FinallyClause const * clause ) { 1158 assertf( !options.genC, "FinallyClause should not reach code generation." ); 1159 1160 output << " finally "; 1161 clause->body->accept( *visitor ); 1144 1162 } 1145 1163 -
src/CodeGen/CodeGenerator.hpp
rf32448e r550446f 106 106 void postvisit( ast::ReturnStmt const * ); 107 107 void postvisit( ast::ThrowStmt const * ); 108 void postvisit( ast::TryStmt const * ); 108 109 void postvisit( ast::CatchClause const * ); 110 void postvisit( ast::FinallyClause const * ); 109 111 void postvisit( ast::WaitForStmt const * ); 110 112 void postvisit( ast::WithStmt const * );
Note:
See TracChangeset
for help on using the changeset viewer.