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/PtrsCastable.cc

    r75308bcc r8e18b8e  
    5757                                return -1;
    5858                        } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) {
    59                                 EqvClass eqvClass;
    6059                                if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
    6160                                        if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
     
    6463                                                } // if
    6564                                        } //if
    66                                 } else if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
    67                                         if ( eqvClass.data.kind == TypeDecl::Ftype ) {
     65                                } else if ( const EqvClass *eqvClass = env.lookup( typeInst->get_name() ) ) {
     66                                        if ( eqvClass->data.kind == TypeDecl::Ftype ) {
    6867                                                return -1;
    6968                                        } // if
     
    7978        int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
    8079                if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
    81                         EqvClass eqvClass;
    82                         if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
     80                        if ( const EqvClass *eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {
    8381                                // xxx - should this be ptrsCastable?
    84                                 return ptrsAssignable( src, eqvClass.type, env );
     82                                return ptrsAssignable( src, eqvClass->type, env );
    8583                        } // if
    8684                } // if
Note: See TracChangeset for help on using the changeset viewer.