Changeset 522363e for src/Common/PassVisitor.impl.h
- Timestamp:
- Sep 14, 2017, 1:46:06 PM (6 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 3e3d923, bff09c8, f92c696
- Parents:
- c57ded70
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.impl.h
rc57ded70 r522363e 66 66 DeclList_t* beforeDecls = visitor.get_beforeDecls(); 67 67 DeclList_t* afterDecls = visitor.get_afterDecls(); 68 SemanticError errors; 68 69 69 70 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { … … 73 74 if ( i == decls.end() ) break; 74 75 75 // run mutator on declaration 76 maybeAccept( *i, visitor ); 76 try { 77 // run visitor on declaration 78 maybeAccept( *i, visitor ); 79 } catch( SemanticError &e ) { 80 e.set_location( (*i)->location ); 81 errors.append( e ); 82 } 77 83 78 84 // splice in new declarations before current decl 79 85 if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); } 80 86 } 87 if ( ! errors.isEmpty() ) { 88 throw errors; 89 } 81 90 } 82 91 … … 86 95 DeclList_t* beforeDecls = mutator.get_beforeDecls(); 87 96 DeclList_t* afterDecls = mutator.get_afterDecls(); 97 SemanticError errors; 88 98 89 99 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { … … 92 102 93 103 if ( i == decls.end() ) break; 94 95 // run mutator on declaration 96 *i = maybeMutate( *i, mutator ); 104 try { 105 // run mutator on declaration 106 *i = maybeMutate( *i, mutator ); 107 } catch( SemanticError &e ) { 108 e.set_location( (*i)->location ); 109 errors.append( e ); 110 } 97 111 98 112 // splice in new declarations before current decl 99 113 if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); } 114 } 115 if ( ! errors.isEmpty() ) { 116 throw errors; 100 117 } 101 118 } … … 445 462 indexerAddEnum( node ); 446 463 447 // unlike structs, contexts, and unions, enums inject their members into the global scope464 // unlike structs, traits, and unions, enums inject their members into the global scope 448 465 maybeMutateRef( node->parameters, *this ); 449 466 maybeMutateRef( node->members , *this );
Note: See TracChangeset
for help on using the changeset viewer.