Ignore:
Timestamp:
Jun 11, 2018, 2:50:06 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env
Children:
6d53e779, 982f95d
Parents:
8e18b8e
Message:

Move AlternativeFinder? find flags to ResolvMode? struct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r8e18b8e r1d7b0a8  
    3333#include "ResolveTypeof.h"               // for resolveTypeof
    3434#include "Resolver.h"
     35#include "ResolvMode.h"                  // for ResolvMode
    3536#include "SymTab/Autogen.h"              // for SizeType
    3637#include "SymTab/Indexer.h"              // for Indexer
     
    165166
    166167        namespace {
    167                 void findUnfinishedKindExpression(Expression * untyped, Alternative & alt, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, bool adjust = false, bool prune = true, bool failFast = true) {
     168                void findUnfinishedKindExpression( Expression * untyped, Alternative & alt, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, ResolvMode mode = ResolvMode{} ) {
    168169                        assertf( untyped, "expected a non-null expression." );
    169170
     
    172173                        TypeEnvironment env;
    173174                        AlternativeFinder finder( indexer, env );
    174                         finder.find( untyped, adjust, prune, failFast );
     175                        finder.find( untyped, mode );
    175176
    176177                        #if 0
     
    218219
    219220                /// resolve `untyped` to the expression whose alternative satisfies `pred` with the lowest cost; kindStr is used for providing better error messages
    220                 void findKindExpression(Expression *& untyped, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, bool adjust = false, bool prune = true, bool failFast = true) {
     221                void findKindExpression(Expression *& untyped, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, ResolvMode mode = ResolvMode{}) {
    221222                        if ( ! untyped ) return;
    222223                        Alternative choice;
    223                         findUnfinishedKindExpression( untyped, choice, indexer, kindStr, pred, adjust, prune, failFast );
     224                        findUnfinishedKindExpression( untyped, choice, indexer, kindStr, pred, mode );
    224225                        finishExpr( choice.expr, choice.env, untyped->env );
    225226                        untyped = choice.expr;
     
    249250                // set up and resolve expression cast to void
    250251                Alternative choice;
    251                 findUnfinishedKindExpression( untyped, choice, indexer, "", standardAlternativeFilter, true );
     252                findUnfinishedKindExpression( untyped, choice, indexer, "", standardAlternativeFilter, ResolvMode::withAdjustment() );
    252253                CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( choice.expr );
    253254                env = std::move( choice.env );
Note: See TracChangeset for help on using the changeset viewer.