Ignore:
Timestamp:
Oct 19, 2017, 12:01:04 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
837ce06
Parents:
b96ec83 (diff), a15b72c (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' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    rb96ec83 r6840e7c  
    7575
    7676        namespace {
    77                 void printAlts( const AltList &list, std::ostream &os, int indent = 0 ) {
     77                void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt = 0 ) {
     78                        Indenter indent = { Indenter::tabsize, indentAmt };
    7879                        for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) {
    7980                                i->print( os, indent );
     
    195196                                AltList winners;
    196197                                findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) );
    197                                 stream << "Cannot choose between " << winners.size() << " alternatives for expression ";
     198                                stream << "Cannot choose between " << winners.size() << " alternatives for expression\n";
    198199                                expr->print( stream );
    199                                 stream << "Alternatives are:";
    200                                 printAlts( winners, stream, 8 );
     200                                stream << "Alternatives are:\n";
     201                                printAlts( winners, stream, 1 );
    201202                                throw SemanticError( stream.str() );
    202203                        }
     
    604605                                Alternative newerAlt( newAlt );
    605606                                newerAlt.env = newEnv;
    606                                 assert( (*candidate)->get_uniqueId() );
     607                                assertf( (*candidate)->get_uniqueId(), "Assertion candidate does not have a unique ID: %s", toString( *candidate ).c_str() );
    607608                                DeclarationWithType *candDecl = static_cast< DeclarationWithType* >( Declaration::declFromId( (*candidate)->get_uniqueId() ) );
    608609
     
    728729                PRINT(
    729730                        std::cerr << "known function ops:" << std::endl;
    730                         printAlts( funcOpFinder.alternatives, std::cerr, 8 );
     731                        printAlts( funcOpFinder.alternatives, std::cerr, 1 );
    731732                )
    732733
     
    838839        bool isLvalue( Expression *expr ) {
    839840                // xxx - recurse into tuples?
    840                 return expr->has_result() && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) );
     841                return expr->result && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) );
    841842        }
    842843
     
    972973                PRINT( std::cerr << "nameExpr is " << nameExpr->get_name() << std::endl; )
    973974                for ( std::list< DeclarationWithType* >::iterator i = declList.begin(); i != declList.end(); ++i ) {
    974                         VariableExpr newExpr( *i, nameExpr->get_argName() );
     975                        VariableExpr newExpr( *i );
    975976                        alternatives.push_back( Alternative( newExpr.clone(), env, Cost::zero ) );
    976977                        PRINT(
     
    12671268                // O(N^2) checks of d-types with e-types
    12681269                for ( InitAlternative & initAlt : initExpr->get_initAlts() ) {
    1269                         Type * toType = resolveTypeof( initAlt.type, indexer );
     1270                        Type * toType = resolveTypeof( initAlt.type->clone(), indexer );
    12701271                        SymTab::validateType( toType, &indexer );
    12711272                        adjustExprType( toType, env, indexer );
Note: See TracChangeset for help on using the changeset viewer.