Changes in / [27caf8d:535adab]
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/GenType.cc
r27caf8d r535adab 237 237 void GenType::visit( TupleType * tupleType ) { 238 238 assertf( ! genC, "Tuple types should not reach code generation." ); 239 Visitor::visit( tupleType );240 239 unsigned int i = 0; 241 240 std::ostringstream os; … … 245 244 os << genType( t, "", pretty, genC, lineMarks ) << (i == tupleType->size() ? "" : ", "); 246 245 } 247 os << "] ";246 os << "] "; 248 247 typeString = os.str() + typeString; 249 248 } -
src/GenPoly/InstantiateGeneric.cc
r27caf8d r535adab 367 367 concDecl->set_body( inst->get_baseStruct()->has_body() ); 368 368 substituteMembers( inst->get_baseStruct()->get_members(), *inst->get_baseParameters(), typeSubs, concDecl->get_members() ); 369 DeclMutator::addDeclaration( concDecl ); 370 insert( inst, typeSubs, concDecl ); 369 insert( inst, typeSubs, concDecl ); // must insert before recursion 371 370 concDecl->acceptMutator( *this ); // recursively instantiate members 371 DeclMutator::addDeclaration( concDecl ); // must occur before declaration is added so that member instantiations appear first 372 372 } 373 373 StructInstType *newInst = new StructInstType( inst->get_qualifiers(), concDecl->get_name() ); … … 422 422 concDecl->set_body( inst->get_baseUnion()->has_body() ); 423 423 substituteMembers( inst->get_baseUnion()->get_members(), *inst->get_baseParameters(), typeSubs, concDecl->get_members() ); 424 DeclMutator::addDeclaration( concDecl ); 425 insert( inst, typeSubs, concDecl ); 424 insert( inst, typeSubs, concDecl ); // must insert before recursion 426 425 concDecl->acceptMutator( *this ); // recursively instantiate members 426 DeclMutator::addDeclaration( concDecl ); // must occur before declaration is added so that member instantiations appear first 427 427 } 428 428 UnionInstType *newInst = new UnionInstType( inst->get_qualifiers(), concDecl->get_name() ); -
src/InitTweak/FixInit.cc
r27caf8d r535adab 619 619 620 620 Expression * FixCopyCtors::mutate( StmtExpr * stmtExpr ) { 621 stmtExpr = safe_dynamic_cast< StmtExpr * >( Parent::mutate( stmtExpr ) ); 621 // function call temporaries should be placed at statement-level, rather than nested inside of a new statement expression, 622 // since temporaries can be shared across sub-expressions, e.g. 623 // [A, A] f(); 624 // g([A] x, [A] y); 625 // f(g()); 626 // f is executed once, so the return temporary is shared across the tuple constructors for x and y. 627 std::list< Statement * > & stmts = stmtExpr->get_statements()->get_kids(); 628 for ( Statement *& stmt : stmts ) { 629 stmt = stmt->acceptMutator( *this ); 630 } // for 631 // stmtExpr = safe_dynamic_cast< StmtExpr * >( Parent::mutate( stmtExpr ) ); 622 632 assert( stmtExpr->get_result() ); 623 633 Type * result = stmtExpr->get_result(); -
src/SynTree/TypeSubstitution.cc
r27caf8d r535adab 166 166 boundVars.insert( (*tyvar )->get_name() ); 167 167 } // for 168 } // if169 // bind type variables from generic type instantiations170 std::list< TypeDecl* > *baseParameters = type->get_baseParameters();171 if ( baseParameters && ! type->get_parameters().empty()) {172 for ( std::list< TypeDecl* >::const_iterator tyvar = baseParameters->begin(); tyvar != baseParameters->end(); ++tyvar ) {173 boundVars.insert( (*tyvar)->get_name() );174 } // for168 // bind type variables from generic type instantiations 169 std::list< TypeDecl* > *baseParameters = type->get_baseParameters(); 170 if ( baseParameters && ! type->get_parameters().empty() ) { 171 for ( std::list< TypeDecl* >::const_iterator tyvar = baseParameters->begin(); tyvar != baseParameters->end(); ++tyvar ) { 172 boundVars.insert( (*tyvar)->get_name() ); 173 } // for 174 } // if 175 175 } // if 176 176 Type *ret = Mutator::mutate( type ); -
src/main.cc
r27caf8d r535adab 64 64 bresolvep = false, 65 65 bboxp = false, 66 bcodegenp = false, 66 67 ctorinitp = false, 67 68 declstatsp = false, … … 306 307 OPTPRINT( "box" ) 307 308 GenPoly::box( translationUnit ); 309 310 if ( bcodegenp ) { 311 dump( translationUnit ); 312 return 0; 313 } 308 314 309 315 if ( optind < argc ) { // any commands after the flags and input file ? => output file name … … 377 383 378 384 int c; 379 while ( (c = getopt_long( argc, argv, "abBc defglLmnpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {385 while ( (c = getopt_long( argc, argv, "abBcCdefglLmnpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) { 380 386 switch ( c ) { 381 387 case Ast: … … 393 399 case 'c': // print after constructors and destructors are replaced 394 400 ctorinitp = true; 401 break; 402 case 'C': // print before code generation 403 bcodegenp = true; 395 404 break; 396 405 case DeclStats:
Note: See TracChangeset
for help on using the changeset viewer.