Changeset 43ee2a8


Ignore:
Timestamp:
Aug 14, 2015, 1:10:27 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
09f800b
Parents:
e869d663 (diff), 543159b (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 /u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CastCost.cc

    re869d663 r43ee2a8  
    6666
    6767        void CastCost::visit( BasicType *basicType ) {
    68                 if ( dynamic_cast< PointerType* >( dest ) ) {
     68                PointerType *destAsPointer = dynamic_cast< PointerType* >( dest );
     69                if ( destAsPointer && basicType->isInteger() ) {
    6970                        cost = Cost( 1, 0, 0 );
    7071                } else {
     
    7778                        if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) {
    7879                                cost = Cost( 0, 0, 1 );
    79                         } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
    80                                 if ( destAsBasic->isInteger() ) {
    81                                         cost = Cost( 1, 0, 0 );
    82                                 } // if
    8380                        } else {
    8481                                TypeEnvironment newEnv( env );
     
    9289                                } // if
    9390                        } // if
    94                 } // if
     91                } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
     92                        if ( destAsBasic->isInteger() ) {
     93                                cost = Cost( 1, 0, 0 );
     94                        } // if
     95                }
    9596        }
    9697} // namespace ResolvExpr
Note: See TracChangeset for help on using the changeset viewer.