Changeset d55d7a6 for src/ControlStruct
- Timestamp:
- Feb 15, 2018, 3:58:56 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:
- 75e3cb2
- Parents:
- d27e340
- Location:
- src/ControlStruct
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptTranslate.cc
rd27e340 rd55d7a6 572 572 // Pass. 573 573 } else if ( CatchStmt::Terminate == catchStmt->get_kind() ) { 574 throw SemanticError( "catch must have exception type");574 throw SemanticError(catchStmt->location, "catch must have exception type"); 575 575 } else { 576 throw SemanticError( "catchResume must have exception type");576 throw SemanticError(catchStmt->location, "catchResume must have exception type"); 577 577 } 578 578 -
src/ControlStruct/LabelFixer.cc
rd27e340 rd55d7a6 92 92 } else if ( labelTable[ l ]->defined() ) { 93 93 // defined twice, error 94 throw SemanticError( "Duplicate definition of label: " + l.get_name() );94 throw 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 … … 121 121 for ( std::map< Label, Entry * >::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) { 122 122 if ( ! i->second->defined() ) { 123 throw SemanticError( "Use of undefined label: " + i->first.get_name() );123 throw 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/MLEMutator.cc
rd27e340 rd55d7a6 115 115 } else { 116 116 // break target is outmost control structure 117 if ( enclosingControlStructures.empty() ) throw SemanticError( "'break' outside a loop, switch, or labelled block" );117 if ( enclosingControlStructures.empty() ) throw 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 throw SemanticError( toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) );126 throw SemanticError( branchStmt->location, toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) ); 127 127 } // if 128 128 break;
Note:
See TracChangeset
for help on using the changeset viewer.