// // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // MLEMutator.cc -- // // Author : Rodolfo G. Esteves // Created On : Mon May 18 07:44:20 2015 // Last Modified By : Rob Schluntz // Last Modified On : Thu Jun 04 15:12:33 2015 // Update Count : 173 // #include #include #include "MLEMutator.h" #include "SynTree/Statement.h" #include "SynTree/Expression.h" namespace ControlStruct { MLEMutator::~MLEMutator() { delete targetTable; targetTable = 0; } // break labels have to come after the statement they break out of, // so mutate a statement, then if they inform us through the breakLabel field // tha they need a place to jump to on a break statement, add the break label // to the body of statements void MLEMutator::fixBlock( std::list< Statement * > &kids ) { for ( std::list< Statement * >::iterator k = kids.begin(); k != kids.end(); k++ ) { *k = (*k)->acceptMutator(*this); if ( ! get_breakLabel().empty() ) { std::list< Statement * >::iterator next = k+1; if ( next == kids.end() ) { std::list