Ignore:
Timestamp:
Sep 5, 2017, 3:41:04 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
416cc86
Parents:
800d275 (diff), 3f8dd01 (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/AlternativeFinder.cc

    r800d275 r235b41f  
    698698
    699699        void AlternativeFinder::visit( UntypedExpr *untypedExpr ) {
    700                 {
    701                         std::string fname = InitTweak::getFunctionName( untypedExpr );
    702                         if ( fname == "&&" ) {
    703                                 VoidType v = Type::Qualifiers();                // resolve to type void *
    704                                 PointerType pt( Type::Qualifiers(), v.clone() );
    705                                 UntypedExpr *vexpr = untypedExpr->clone();
    706                                 vexpr->set_result( pt.clone() );
    707                                 alternatives.push_back( Alternative( vexpr, env, Cost::zero) );
    708                                 return;
    709                         }
    710                 }
    711 
    712700                AlternativeFinder funcFinder( indexer, env );
    713701                funcFinder.findWithAdjustment( untypedExpr->get_function() );
     
    749737                                if ( PointerType *pointer = dynamic_cast< PointerType* >( func->expr->get_result()->stripReferences() ) ) {
    750738                                        if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
    751                                                 referenceToRvalueConversion( func->expr );
     739                                                Alternative newFunc( *func );
     740                                                referenceToRvalueConversion( newFunc.expr );
    752741                                                for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
    753742                                                        // XXX
    754743                                                        //Designators::check_alternative( function, *actualAlt );
    755                                                         makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
     744                                                        makeFunctionAlternatives( newFunc, function, *actualAlt, std::back_inserter( candidates ) );
    756745                                                }
    757746                                        }
    758747                                } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->get_result()->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer)
    759                                         referenceToRvalueConversion( func->expr );
    760748                                        EqvClass eqvClass;
    761749                                        if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) {
    762750                                                if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) {
     751                                                        Alternative newFunc( *func );
     752                                                        referenceToRvalueConversion( newFunc.expr );
    763753                                                        for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
    764                                                                 makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
     754                                                                makeFunctionAlternatives( newFunc, function, *actualAlt, std::back_inserter( candidates ) );
    765755                                                        } // for
    766756                                                } // if
     
    773763                                        if ( PointerType *pointer = dynamic_cast< PointerType* >( funcOp->expr->get_result()->stripReferences() ) ) {
    774764                                                if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
    775                                                         referenceToRvalueConversion( funcOp->expr );
     765                                                        Alternative newFunc( *funcOp );
     766                                                        referenceToRvalueConversion( newFunc.expr );
    776767                                                        for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
    777768                                                                AltList currentAlt;
    778769                                                                currentAlt.push_back( *func );
    779770                                                                currentAlt.insert( currentAlt.end(), actualAlt->begin(), actualAlt->end() );
    780                                                                 makeFunctionAlternatives( *funcOp, function, currentAlt, std::back_inserter( candidates ) );
     771                                                                makeFunctionAlternatives( newFunc, function, currentAlt, std::back_inserter( candidates ) );
    781772                                                        } // for
    782773                                                } // if
     
    853844                        } // if
    854845                } // for
     846        }
     847
     848        void AlternativeFinder::visit( LabelAddressExpr * expr ) {
     849                alternatives.push_back( Alternative( expr->clone(), env, Cost::zero) );
    855850        }
    856851
Note: See TracChangeset for help on using the changeset viewer.