Changes in / [f6cc2096:c3b96677]
- Location:
- src
- Files:
-
- 3 added
- 9 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/MLEMutator.cc
rf6cc2096 rc3b96677 154 154 return switchStmt; 155 155 } 156 157 void addUnused( Statement * stmt, const Label & originalTarget ) {158 // break/continue without a label doesn't need unused attribute159 if ( originalTarget == "" ) return;160 // add unused attribute to the originalTarget of a labelled break/continue161 for ( Label & l : stmt->get_labels() ) {162 // find the label to add unused attribute to163 if ( l == originalTarget ) {164 for ( Attribute * attr : l.get_attributes() ) {165 // ensure attribute isn't added twice166 if ( attr->get_name() == "unused" ) return;167 }168 l.get_attributes().push_back( new Attribute( "unused" ) );169 return;170 }171 }172 assertf( false, "Could not find label '%s' on statement %s", originalTarget.get_name().c_str(), toString( stmt ).c_str() );173 }174 175 156 176 157 Statement *MLEMutator::mutate( BranchStmt *branchStmt ) throw ( SemanticError ) { … … 223 204 } // switch 224 205 225 // add unused attribute to label to silence warnings226 addUnused( targetEntry->get_controlStructure(), branchStmt->get_originalTarget() );227 228 206 // transform break/continue statements into goto to simplify later handling of branches 229 207 delete branchStmt;
Note: See TracChangeset
for help on using the changeset viewer.