Changeset 90152a4 for src/ControlStruct/LabelFixer.cc
- Timestamp:
- Aug 27, 2018, 4:40:34 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b7c89aa
- Parents:
- f9feab8 (diff), 305581d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/LabelFixer.cc
rf9feab8 r90152a4 44 44 45 45 void LabelFixer::postvisit( FunctionDecl * functionDecl ) { 46 MLEMutatormlemut( resolveJumps(), generator );46 PassVisitor<MLEMutator> mlemut( resolveJumps(), generator ); 47 47 functionDecl->acceptMutator( mlemut ); 48 48 } … … 92 92 } else if ( labelTable[ l ]->defined() ) { 93 93 // defined twice, error 94 throw SemanticError("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 throw SemanticError("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();
Note: See TracChangeset
for help on using the changeset viewer.