Changeset 400b8be for src/ControlStruct/ExceptTranslateNew.cpp
- Timestamp:
- Mar 28, 2022, 10:41:45 AM (2 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 8e819a9
- Parents:
- f5bace8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptTranslateNew.cpp
rf5bace8 r400b8be 26 26 namespace { 27 27 28 typedef std::list<ast::Catch Stmt*> CatchList;28 typedef std::list<ast::CatchClause*> CatchList; 29 29 30 30 void appendDeclStmt( ast::CompoundStmt * block, ast::DeclWithType * item ) { … … 45 45 {} 46 46 47 void previsit( const ast::Catch Stmt* stmt );47 void previsit( const ast::CatchClause * stmt ); 48 48 const ast::Stmt * postvisit( const ast::ThrowStmt * stmt ); 49 49 }; … … 88 88 } 89 89 90 void TranslateThrowsCore::previsit( const ast::Catch Stmt* stmt ) {90 void TranslateThrowsCore::previsit( const ast::CatchClause * stmt ) { 91 91 // Validate the statement's form. 92 92 const ast::ObjectDecl * decl = stmt->decl.as<ast::ObjectDecl>(); … … 147 147 ast::FunctionDecl * create_terminate_catch( CatchList &handlers ); 148 148 ast::CompoundStmt * create_single_matcher( 149 const ast::DeclWithType * except_obj, ast::Catch Stmt* modded_handler );149 const ast::DeclWithType * except_obj, ast::CatchClause * modded_handler ); 150 150 ast::FunctionDecl * create_terminate_match( CatchList &handlers ); 151 151 ast::CompoundStmt * create_terminate_caller( CodeLocation loc, ast::FunctionDecl * try_wrapper, … … 338 338 ast::FunctionDecl * TryMutatorCore::create_terminate_catch( 339 339 CatchList &handlers ) { 340 std::vector<ast::ptr<ast:: Stmt>> handler_wrappers;340 std::vector<ast::ptr<ast::CaseClause>> handler_wrappers; 341 341 342 342 assert (!handlers.empty()); … … 352 352 for ( ; it != handlers.end() ; ++it ) { 353 353 ++index; 354 ast::Catch Stmt* handler = *it;354 ast::CatchClause * handler = *it; 355 355 const CodeLocation loc = handler->location; 356 356 … … 390 390 // handler->body = nullptr; 391 391 392 handler_wrappers.push_back( new ast::Case Stmt(loc,392 handler_wrappers.push_back( new ast::CaseClause(loc, 393 393 ast::ConstantExpr::from_int(loc, index) , 394 394 { block, new ast::ReturnStmt( loc, nullptr ) } … … 410 410 // except_obj is referenced, modded_handler will be freed. 411 411 ast::CompoundStmt * TryMutatorCore::create_single_matcher( 412 const ast::DeclWithType * except_obj, ast::Catch Stmt* modded_handler ) {412 const ast::DeclWithType * except_obj, ast::CatchClause * modded_handler ) { 413 413 // { 414 414 // `modded_handler.decl` … … 465 465 for ( it = handlers.begin() ; it != handlers.end() ; ++it ) { 466 466 ++index; 467 ast::Catch Stmt* handler = *it;467 ast::CatchClause * handler = *it; 468 468 469 469 // Body should have been taken by create_terminate_catch. … … 520 520 CatchList::iterator it; 521 521 for ( it = handlers.begin() ; it != handlers.end() ; ++it ) { 522 ast::Catch Stmt* handler = *it;522 ast::CatchClause * handler = *it; 523 523 const CodeLocation loc = handler->location; 524 524 // Modifiy body. … … 587 587 ast::TryStmt * tryStmt ) { 588 588 // void finally() { `finally->block` } 589 const ast::Finally Stmt* finally = tryStmt->finally;589 const ast::FinallyClause * finally = tryStmt->finally; 590 590 const ast::CompoundStmt * body = finally->body; 591 591
Note: See TracChangeset
for help on using the changeset viewer.