Ignore:
Timestamp:
Jan 11, 2018, 10:50:03 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
bd0b6b62
Parents:
80e8582
Message:

Refactor ConversionCost? and CastCost? to remove explicit recursive accept calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ConversionCost.h

    r80e8582 r721cd19f  
    2929        class TypeEnvironment;
    3030
     31        typedef std::function<Cost(Type *, Type *, const SymTab::Indexer &, const TypeEnvironment &)> CostFunction;
    3132        class ConversionCost : public Visitor {
    3233          public:
    33                 ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
     34                ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction );
    3435
    3536                Cost get_cost() const { return cost; }
     
    5556                Cost cost;
    5657                const TypeEnvironment &env;
     58                CostFunction costFunc;
    5759        };
    5860
    59         typedef std::function<int(Type *, Type *, const TypeEnvironment &, const SymTab::Indexer &)> PtrsFunction;
     61        typedef std::function<int(Type *, Type *, const SymTab::Indexer &, const TypeEnvironment &)> PtrsFunction;
    6062        Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func );
    6163} // namespace ResolvExpr
Note: See TracChangeset for help on using the changeset viewer.