Changeset a16764a6 for src/ControlStruct
- Timestamp:
- Feb 28, 2018, 4:48:22 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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:
- 446ffa3
- Parents:
- 6a8df56
- Location:
- src/ControlStruct
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptTranslate.cc
r6a8df56 ra16764a6 572 572 // Pass. 573 573 } else if ( CatchStmt::Terminate == catchStmt->get_kind() ) { 574 throwSemanticError(catchStmt->location, "catch must have exception type");574 SemanticError(catchStmt->location, "catch must have exception type"); 575 575 } else { 576 throwSemanticError(catchStmt->location, "catchResume must have exception type");576 SemanticError(catchStmt->location, "catchResume must have exception type"); 577 577 } 578 578 -
src/ControlStruct/LabelFixer.cc
r6a8df56 ra16764a6 92 92 } else if ( labelTable[ l ]->defined() ) { 93 93 // defined twice, error 94 throwSemanticError( l.get_statement()->location, "Duplicate definition of label: " + l.get_name() );94 SemanticError( l.get_statement()->location, "Duplicate definition of label: " + l.get_name() ); 95 95 } else { 96 96 // used previously, but undefined until now -> link with this entry … … 117 117 118 118 // Builds a table that maps a label to its defining statement. 119 std::map<Label, Statement * > *LabelFixer::resolveJumps() throw ( SemanticError ) {119 std::map<Label, Statement * > *LabelFixer::resolveJumps() throw ( SemanticErrorException ) { 120 120 std::map< Label, Statement * > *ret = new std::map< Label, Statement * >(); 121 121 for ( std::map< Label, Entry * >::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) { 122 122 if ( ! i->second->defined() ) { 123 throwSemanticError( i->first.get_statement()->location, "Use of undefined label: " + i->first.get_name() );123 SemanticError( i->first.get_statement()->location, "Use of undefined label: " + i->first.get_name() ); 124 124 } 125 125 (*ret)[ i->first ] = i->second->get_definition(); -
src/ControlStruct/LabelFixer.h
r6a8df56 ra16764a6 33 33 LabelFixer( LabelGenerator *gen = 0 ); 34 34 35 std::map < Label, Statement * > *resolveJumps() throw ( SemanticError );35 std::map < Label, Statement * > *resolveJumps() throw ( SemanticErrorException ); 36 36 37 37 // Declarations -
src/ControlStruct/MLEMutator.cc
r6a8df56 ra16764a6 98 98 99 99 100 Statement *MLEMutator::postmutate( BranchStmt *branchStmt ) throw ( SemanticError ) {100 Statement *MLEMutator::postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException ) { 101 101 std::string originalTarget = branchStmt->originalTarget; 102 102 … … 115 115 } else { 116 116 // break target is outmost control structure 117 if ( enclosingControlStructures.empty() ) throwSemanticError( branchStmt->location, "'break' outside a loop, switch, or labelled block" );117 if ( enclosingControlStructures.empty() ) SemanticError( branchStmt->location, "'break' outside a loop, switch, or labelled block" ); 118 118 targetEntry = enclosingControlStructures.rbegin(); 119 119 } // if … … 124 124 // ensure that selected target is valid 125 125 if ( targetEntry == enclosingControlStructures.rend() || (isContinue && ! isLoop( targetEntry->get_controlStructure() ) ) ) { 126 throwSemanticError( branchStmt->location, toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) );126 SemanticError( branchStmt->location, toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) ); 127 127 } // if 128 128 break; -
src/ControlStruct/MLEMutator.h
r6a8df56 ra16764a6 37 37 38 38 void premutate( CompoundStmt *cmpndStmt ); 39 Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticError );39 Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException ); 40 40 void premutate( WhileStmt *whileStmt ); 41 41 Statement * postmutate( WhileStmt *whileStmt ); -
src/ControlStruct/Mutate.cc
r6a8df56 ra16764a6 18 18 19 19 #include "Common/PassVisitor.h" // for mutateAll 20 #include "Common/SemanticError.h" // for SemanticError21 20 #include "ForExprMutator.h" // for ForExprMutator 22 21 #include "LabelFixer.h" // for LabelFixer
Note:
See TracChangeset
for help on using the changeset viewer.