Ignore:
Timestamp:
May 31, 2018, 4:24:49 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
0182bfa, 1d7b0a8
Parents:
75308bcc
Message:

stop eagerly copying EqvClass? on lookup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CastCost.cc

    r75308bcc r8e18b8e  
    4343        Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
    4444                if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
    45                         EqvClass eqvClass;
    46                         NamedTypeDecl *namedType;
    47                         if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
    48                                 if ( eqvClass.type ) {
    49                                         return castCost( src, eqvClass.type, indexer, env );
     45                        if ( const EqvClass* eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {
     46                                if ( eqvClass->type ) {
     47                                        return castCost( src, eqvClass->type, indexer, env );
    5048                                } else {
    5149                                        return Cost::infinity;
    5250                                }
    53                         } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) {
     51                        } else if ( NamedTypeDecl *namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) {
    5452                                // all typedefs should be gone by this point
    5553                                TypeDecl *type = strict_dynamic_cast< TypeDecl* >( namedType );
Note: See TracChangeset for help on using the changeset viewer.