Changeset 63c0dbf
- Timestamp:
- Apr 8, 2016, 3:49:19 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, string, with_gc
- Children:
- bfae637
- Parents:
- adc6781
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
radc6781 r63c0dbf 205 205 ObjectDecl *makeTemporary( Type *type ); 206 206 207 std::map< std::string, DeclarationWithType *> assignOps;///< Currently known type variable assignment operators207 ScopedMap< std::string, DeclarationWithType *> assignOps; ///< Currently known type variable assignment operators 208 208 ResolvExpr::TypeMap< DeclarationWithType > scopedAssignOps; ///< Currently known assignment operators 209 209 ScopedMap< std::string, DeclarationWithType* > adapters; ///< Set of adapter functions in the current scope … … 665 665 doBeginScope(); 666 666 TyVarMap oldtyVars = scopeTyVars; 667 std::map< std::string, DeclarationWithType *> oldassignOps = assignOps;667 assignOps.beginScope(); 668 668 DeclarationWithType *oldRetval = retval; 669 669 bool oldUseRetval = useRetval; … … 707 707 708 708 scopeTyVars = oldtyVars; 709 assignOps = oldassignOps; 710 // std::cerr << "end FunctionDecl: "; 711 // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) { 712 // std::cerr << i->first << " "; 713 // } 714 // std::cerr << "\n"; 709 assignOps.endScope(); 715 710 retval = oldRetval; 716 711 useRetval = oldUseRetval; … … 1386 1381 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType *>( retval->get_type() ) ) { 1387 1382 // find assignment operator for type variable 1388 std::map< std::string, DeclarationWithType *>::const_iterator assignIter = assignOps.find( typeInst->get_name() );1383 ScopedMap< std::string, DeclarationWithType *>::const_iterator assignIter = assignOps.find( typeInst->get_name() ); 1389 1384 if ( assignIter == assignOps.end() ) { 1390 1385 throw SemanticError( "Attempt to return dtype or ftype object in ", returnStmt->get_expr() ); … … 1420 1415 DeclarationWithType *assertAssign = 0; 1421 1416 if ( TypeInstType *formalTypeInstType = dynamic_cast< TypeInstType* >( formalType ) ) { 1422 std::map< std::string, DeclarationWithType *>::const_iterator assertAssignIt = assignOps.find( formalTypeInstType->get_name() );1417 ScopedMap< std::string, DeclarationWithType *>::const_iterator assertAssignIt = assignOps.find( formalTypeInstType->get_name() ); 1423 1418 if ( assertAssignIt == assignOps.end() ) { 1424 1419 throw SemanticError( "No assignment operation found for ", formalTypeInstType );
Note: See TracChangeset
for help on using the changeset viewer.