Changeset 63c0dbf


Ignore:
Timestamp:
Apr 8, 2016, 3:49:19 PM (9 years ago)
Author:
Aaron Moss <a3moss@…>
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
Message:

Made Pass1::assignOps a ScopedMap?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    radc6781 r63c0dbf  
    205205                        ObjectDecl *makeTemporary( Type *type );
    206206
    207                         std::map< std::string, DeclarationWithType *> assignOps;     ///< Currently known type variable assignment operators
     207                        ScopedMap< std::string, DeclarationWithType *> assignOps;    ///< Currently known type variable assignment operators
    208208                        ResolvExpr::TypeMap< DeclarationWithType > scopedAssignOps;  ///< Currently known assignment operators
    209209                        ScopedMap< std::string, DeclarationWithType* > adapters;     ///< Set of adapter functions in the current scope
     
    665665                                doBeginScope();
    666666                                TyVarMap oldtyVars = scopeTyVars;
    667                                 std::map< std::string, DeclarationWithType *> oldassignOps = assignOps;
     667                                assignOps.beginScope();
    668668                                DeclarationWithType *oldRetval = retval;
    669669                                bool oldUseRetval = useRetval;
     
    707707
    708708                                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();
    715710                                retval = oldRetval;
    716711                                useRetval = oldUseRetval;
     
    13861381                                if ( TypeInstType *typeInst = dynamic_cast< TypeInstType *>( retval->get_type() ) ) {
    13871382                                        // 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() );
    13891384                                        if ( assignIter == assignOps.end() ) {
    13901385                                                throw SemanticError( "Attempt to return dtype or ftype object in ", returnStmt->get_expr() );
     
    14201415                                                DeclarationWithType *assertAssign = 0;
    14211416                                                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() );
    14231418                                                        if ( assertAssignIt == assignOps.end() ) {
    14241419                                                                throw SemanticError( "No assignment operation found for ", formalTypeInstType );
Note: See TracChangeset for help on using the changeset viewer.