Ignore:
Timestamp:
Nov 29, 2016, 3:30:59 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
8e5724e
Parents:
3a2128f (diff), 9129a84 (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 plg2:software/cfa/cfa-cc

Conflicts:

src/Parser/parser.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Specialize.cc

    r3a2128f r1f44196  
    148148
    149149        Expression * Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ) {
    150                 assert( ! actual->get_results().empty() ); // using front, should have this assert
    151                 if ( needsSpecialization( formalType, actual->get_results().front(), env ) ) {
     150                assertf( actual->has_result(), "attempting to specialize an untyped expression" );
     151                if ( needsSpecialization( formalType, actual->get_result(), env ) ) {
    152152                        FunctionType *funType;
    153153                        if ( ( funType = getFunctionType( formalType ) ) ) {
     
    172172        void Specialize::handleExplicitParams( ApplicationExpr *appExpr ) {
    173173                // create thunks for the explicit parameters
    174                 assert( ! appExpr->get_function()->get_results().empty() );
    175                 FunctionType *function = getFunctionType( appExpr->get_function()->get_results().front() );
     174                assert( appExpr->get_function()->has_result() );
     175                FunctionType *function = getFunctionType( appExpr->get_function()->get_result() );
    176176                assert( function );
    177177                std::list< DeclarationWithType* >::iterator formal;
     
    201201        Expression * Specialize::mutate( AddressExpr *addrExpr ) {
    202202                addrExpr->get_arg()->acceptMutator( *this );
    203                 assert( ! addrExpr->get_results().empty() );
    204                 addrExpr->set_arg( doSpecialization( addrExpr->get_results().front(), addrExpr->get_arg() ) );
     203                assert( addrExpr->has_result() );
     204                addrExpr->set_arg( doSpecialization( addrExpr->get_result(), addrExpr->get_arg() ) );
    205205                return addrExpr;
    206206        }
     
    208208        Expression * Specialize::mutate( CastExpr *castExpr ) {
    209209                castExpr->get_arg()->acceptMutator( *this );
    210                 if ( castExpr->get_results().empty() ) {
     210                if ( castExpr->get_result()->isVoid() ) {
    211211                        // can't specialize if we don't have a return value
    212212                        return castExpr;
    213213                }
    214                 Expression *specialized = doSpecialization( castExpr->get_results().front(), castExpr->get_arg() );
     214                Expression *specialized = doSpecialization( castExpr->get_result(), castExpr->get_arg() );
    215215                if ( specialized != castExpr->get_arg() ) {
    216216                        // assume here that the specialization incorporates the cast
Note: See TracChangeset for help on using the changeset viewer.