Ignore:
Timestamp:
Jun 12, 2023, 2:45:32 PM (13 months ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ast-experimental, master
Children:
62d62db
Parents:
34b4268 (diff), 251ce80 (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 ast-experimental

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    r34b4268 r24d6572  
    2323#include <vector>
    2424
     25#include "AdjustExprType.hpp"
    2526#include "Candidate.hpp"
    2627#include "CompilationState.h"
    2728#include "Cost.h"
     29#include "CastCost.hpp"
     30#include "PolyCost.hpp"
     31#include "SpecCost.hpp"
     32#include "ConversionCost.h"
    2833#include "ExplodedArg.hpp"
    2934#include "RenameVars.h"           // for renameTyVars
     
    403408                                                        unify(
    404409                                                                ttype, argType, newResult.env, newResult.need, newResult.have,
    405                                                                 newResult.open, symtab )
     410                                                                newResult.open )
    406411                                                ) {
    407412                                                        finalResults.emplace_back( std::move( newResult ) );
     
    474479                                )
    475480
    476                                 if ( unify( paramType, argType, env, need, have, open, symtab ) ) {
     481                                if ( unify( paramType, argType, env, need, have, open ) ) {
    477482                                        unsigned nextExpl = results[i].nextExpl + 1;
    478483                                        if ( nextExpl == expl.exprs.size() ) { nextExpl = 0; }
     
    493498                                        ast::OpenVarSet open = results[i].open;
    494499
    495                                         if ( unify( paramType, cnst->result, env, need, have, open, symtab ) ) {
     500                                        if ( unify( paramType, cnst->result, env, need, have, open ) ) {
    496501                                                results.emplace_back(
    497502                                                        i, new ast::DefaultArgExpr{ cnst->location, cnst }, std::move( env ),
     
    536541
    537542                                // attempt to unify types
    538                                 if ( unify( paramType, argType, env, need, have, open, symtab ) ) {
     543                                if ( unify( paramType, argType, env, need, have, open ) ) {
    539544                                        // add new result
    540545                                        results.emplace_back(
     
    703708                                if ( selfFinder.strictMode ) {
    704709                                        if ( ! unifyExact(
    705                                                 returnType, targetType, funcEnv, funcNeed, funcHave, funcOpen, noWiden(), symtab ) // xxx - is no widening correct?
     710                                                returnType, targetType, funcEnv, funcNeed, funcHave, funcOpen, noWiden() ) // xxx - is no widening correct?
    706711                                        ) {
    707712                                                // unification failed, do not pursue this candidate
     
    711716                                else {
    712717                                        if ( ! unify(
    713                                                 returnType, targetType, funcEnv, funcNeed, funcHave, funcOpen, symtab )
     718                                                returnType, targetType, funcEnv, funcNeed, funcHave, funcOpen )
    714719                                        ) {
    715720                                                // unification failed, do not pursue this candidate
     
    11561161
    11571162                                // unification run for side-effects
    1158                                 unify( toType, cand->expr->result, cand->env, need, have, open, symtab );
     1163                                unify( toType, cand->expr->result, cand->env, need, have, open );
    11591164                                Cost thisCost =
    11601165                                        (castExpr->isGenerated == ast::GeneratedFlag::GeneratedCast)
     
    14971502                                                if (
    14981503                                                        unify(
    1499                                                                 r2->expr->result, r3->expr->result, env, need, have, open, symtab,
     1504                                                                r2->expr->result, r3->expr->result, env, need, have, open,
    15001505                                                                common )
    15011506                                                ) {
     
    15711576                                        if (
    15721577                                                unify(
    1573                                                         r1->expr->result, r2->expr->result, env, need, have, open, symtab,
     1578                                                        r1->expr->result, r2->expr->result, env, need, have, open,
    15741579                                                        common )
    15751580                                        ) {
     
    16771682
    16781683                                        // unification run for side-effects
    1679                                         bool canUnify = unify( toType, cand->expr->result, env, need, have, open, symtab );
     1684                                        bool canUnify = unify( toType, cand->expr->result, env, need, have, open );
    16801685                                        (void) canUnify;
    16811686                                        Cost thisCost = computeConversionCost( cand->expr->result, toType, cand->expr->get_lvalue(),
Note: See TracChangeset for help on using the changeset viewer.