Changeset 0536c03


Ignore:
Timestamp:
Dec 23, 2020, 4:45:08 PM (11 months ago)
Author:
Fangren Yu <f37yu@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
09867ec
Parents:
bd144fd
Message:

remove unnecessary prune

Location:
src/ResolvExpr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    rbd144fd r0536c03  
    905905                        // xxx - is it possible that handleTupleAssignment and main finder both produce candidates?
    906906                        // this means there exists ctor/assign functions with a tuple as first parameter.
    907                         funcFinder.find( untypedExpr->func, selfFinder.candidates.empty() ? ResolvMode::withAdjustment() : ResolvMode::withoutFailFast() );
     907                        ResolvMode mode = {
     908                                true, // adjust
     909                                !untypedExpr->func.as<ast::NameExpr>(), // prune if not calling by name
     910                                selfFinder.candidates.empty() // failfast if other options are not found
     911                        };
     912                        funcFinder.find( untypedExpr->func, mode );
    908913                        // short-circuit if no candidates
    909914                        // if ( funcFinder.candidates.empty() ) return;
  • src/ResolvExpr/ResolvMode.h

    rbd144fd r0536c03  
    2323                const bool failFast;         ///< Fail on no resulting alternatives? [true]
    2424
    25         private:
    2625                constexpr ResolvMode(bool a, bool p, bool ff)
    2726                : adjust(a), prune(p), failFast(ff) {}
    2827
    29         public:
    3028                /// Default settings
    3129                constexpr ResolvMode() : adjust(false), prune(true), failFast(true) {}
Note: See TracChangeset for help on using the changeset viewer.