Changeset 7878974


Ignore:
Timestamp:
Jan 9, 2023, 4:12:05 PM (23 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
53ef99a
Parents:
2cc969c (diff), f76dd1a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/RenameVars.cc

    r2cc969c r7878974  
    8383
    8484                const ast::TypeInstType * rename( const ast::TypeInstType * type ) {
    85                         // rename
    8685                        auto it = idMap.find( type->name );
    87                         if ( it != idMap.end() ) {
    88                                 // unconditionally mutate because map will *always* have different name
    89                                 ast::TypeInstType * mut = ast::shallowCopy( type );
    90                                 // reconcile base node since some copies might have been made
    91                                 mut->base = it->second.base;
    92                                 mut->formal_usage = it->second.formal_usage;
    93                                 mut->expr_id = it->second.expr_id;
    94                     type = mut;
    95                         }
    96 
    97                         return type;
     86                        if ( it == idMap.end() ) return type;
     87
     88                        // Unconditionally mutate because map will *always* have different name.
     89                        ast::TypeInstType * mut = ast::shallowCopy( type );
     90                        // Reconcile base node since some copies might have been made.
     91                        mut->base = it->second.base;
     92                        mut->formal_usage = it->second.formal_usage;
     93                        mut->expr_id = it->second.expr_id;
     94                        return mut;
    9895                }
    9996
     
    187184
    188185const ast::Type * renameTyVars( const ast::Type * t, RenameMode mode, bool reset ) {
    189         // ast::Type *tc = ast::deepCopy(t);
    190186        ast::Pass<RenameVars_new> renamer;
    191187        renamer.core.mode = mode;
Note: See TracChangeset for help on using the changeset viewer.