Changeset f1f481a
- Timestamp:
- Oct 28, 2022, 5:54:15 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 0b1ca47
- Parents:
- 15c93d8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r15c93d8 rf1f481a 221 221 } // anonymous namespace 222 222 223 /// version of mutateAll with special handling for translation unit so you can check the end of the prelude when debugging224 template< typename MutatorType >225 inline void mutateTranslationUnit( std::list< Declaration* > &translationUnit, MutatorType &mutator ) {226 bool seenIntrinsic = false;227 SemanticErrorException errors;228 for ( typename std::list< Declaration* >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) {229 try {230 if ( *i ) {231 if ( (*i)->get_linkage() == LinkageSpec::Intrinsic ) {232 seenIntrinsic = true;233 } else if ( seenIntrinsic ) {234 seenIntrinsic = false; // break on this line when debugging for end of prelude235 }236 237 *i = dynamic_cast< Declaration* >( (*i)->acceptMutator( mutator ) );238 assert( *i );239 } // if240 } catch( SemanticErrorException &e ) {241 errors.append( e );242 } // try243 } // for244 if ( ! errors.isEmpty() ) {245 throw errors;246 } // if247 }248 249 223 void box( std::list< Declaration *>& translationUnit ) { 250 224 PassVisitor<LayoutFunctionBuilder> layoutBuilder; … … 306 280 layoutDecl->fixUniqueId(); 307 281 return layoutDecl; 308 }309 310 /// Makes a unary operation311 Expression *makeOp( const std::string &name, Expression *arg ) {312 UntypedExpr *expr = new UntypedExpr( new NameExpr( name ) );313 expr->args.push_back( arg );314 return expr;315 282 } 316 283
Note: See TracChangeset
for help on using the changeset viewer.