Changeset fc638d2 for src/GenPoly


Ignore:
Timestamp:
Dec 13, 2016, 4:13:08 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
7933351
Parents:
f7e749f
Message:

fixed StmtExpr code in PolyMutator, added missing copy constructor, misc documentation

Location:
src/GenPoly
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/CopyParams.cc

    rf7e749f rfc638d2  
    3838        };
    3939
     40        /// creates local copies of polymorphic function parameters
    4041        void copyParams( std::list< Declaration* > &translationUnit ) {
    4142                CopyParams copier;
     
    5354                        if ( ! modVars.empty() ) {
    5455                                std::map< std::string, DeclarationWithType* > assignOps;
     56                                // xxx - this needs to use constructors, not assignment operators
    5557                                // assume the assignment operator is the first assert param after any "type" parameter
    5658                                for ( Type::ForallList::const_iterator tyVar = funcDecl->get_functionType()->get_forall().begin(); tyVar != funcDecl->get_functionType()->get_forall().end(); ++tyVar ) {
  • src/GenPoly/PolyMutator.cc

    rf7e749f rfc638d2  
    149149                ValueGuard< std::list< Statement* > > oldStmtsToAdd( stmtsToAdd );
    150150                ValueGuard< std::list< Statement* > > oldStmtsToAddAfter( stmtsToAddAfter );
     151                ValueGuard< TypeSubstitution * > oldEnv( env );
    151152
    152                 // xxx - not sure if these are needed, along with appropriate assignments, but I don't think so...
    153                 // ValueGuard< TyVarMap > oldScopeTyVars;
    154                 // ValueGuard< TypeSubstitution * > oldEnv;
     153                // xxx - not sure if this is needed, along with appropriate reset, but I don't think so...
     154                // ValueGuard< TyVarMap > oldScopeTyVars( scopeTyVars );
    155155
    156156                stmtsToAdd.clear();
    157157                stmtsToAddAfter.clear();
     158                // scopeTyVars.clear();
    158159
    159                 stmtExpr->set_result( maybeMutate( stmtExpr->get_result(), *this ) );
    160                 stmtExpr->set_statements( maybeMutate( stmtExpr->get_statements(), *this ) );
    161                 return stmtExpr;
     160                return Parent::mutate( stmtExpr );
    162161        }
    163162
Note: See TracChangeset for help on using the changeset viewer.