Changeset 0f8e4ac for src/ControlStruct
- Timestamp:
- Jun 16, 2016, 12:24:39 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 25296a3
- Parents:
- f4bc57c
- Location:
- src/ControlStruct
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/LabelFixer.cc
rf4bc57c r0f8e4ac 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // LabelFixer.cc -- 7 // LabelFixer.cc -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 86 86 87 87 88 // sets the definition of the labelTable entry to be the provided 88 // sets the definition of the labelTable entry to be the provided 89 89 // statement for every label in the list parameter. Happens for every kind of statement 90 90 Label LabelFixer::setLabelsDef( std::list< Label > &llabel, Statement *definition ) { … … 101 101 } else if ( labelTable[ *i ]->defined() ) { 102 102 // defined twice, error 103 throw SemanticError( "Duplicate definition of label: " + *i);103 throw SemanticError( "Duplicate definition of label: " + (*i).get_name() ); 104 104 } else { 105 105 // used previously, but undefined until now -> link with this entry … … 109 109 } // for 110 110 111 // produce one of the labels attached to this statement to be 111 // produce one of the labels attached to this statement to be 112 112 // temporarily used as the canonical label 113 113 return labelTable[ llabel.front() ]->get_label(); … … 130 130 for ( std::map< Label, Entry * >::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) { 131 131 if ( ! i->second->defined() ) { 132 throw SemanticError( "Use of undefined label: " + i->first );132 throw SemanticError( "Use of undefined label: " + i->first.get_name() ); 133 133 } 134 134 (*ret)[ i->first ] = i->second->get_definition(); -
src/ControlStruct/LabelFixer.h
rf4bc57c r0f8e4ac 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // LabelFixer.h -- 7 // LabelFixer.h -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 20 20 #include "SynTree/SynTree.h" 21 21 #include "SynTree/Visitor.h" 22 #include "SynTree/Label.h" 22 23 #include "LabelGenerator.h" 23 24 24 #include <map> 25 25 … … 74 74 75 75 private: 76 Label label; 76 Label label; 77 77 Statement *definition; 78 78 }; 79 79 80 80 std::map < Label, Entry *> labelTable; 81 81 LabelGenerator *generator; -
src/ControlStruct/LabelGenerator.cc
rf4bc57c r0f8e4ac 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // LabelGenerator.cc -- 7 // LabelGenerator.cc -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 18 18 19 19 #include "LabelGenerator.h" 20 #include "SynTree/Label.h" 20 21 21 22 namespace ControlStruct { -
src/ControlStruct/MLEMutator.h
rf4bc57c r0f8e4ac 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // MLEMutator.h -- 7 // MLEMutator.h -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 23 23 #include "SynTree/SynTree.h" 24 24 #include "SynTree/Mutator.h" 25 #include "SynTree/Label.h" 25 26 26 27 #include "LabelGenerator.h" … … 38 39 Statement *mutate( BranchStmt *branchStmt ) throw ( SemanticError ); 39 40 40 Statement *mutate( CaseStmt *caseStmt ); 41 Statement *mutate( CaseStmt *caseStmt ); 41 42 Statement *mutate( SwitchStmt *switchStmt ); 42 43 Statement *mutate( ChooseStmt *switchStmt ); … … 79 80 Statement *handleLoopStmt( LoopClass *loopStmt ); 80 81 81 template< typename SwitchClass > 82 template< typename SwitchClass > 82 83 Statement *handleSwitchStmt( SwitchClass *switchStmt ); 83 84
Note:
See TracChangeset
for help on using the changeset viewer.