Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ConversionCost.h

    re6b42e7 r7d01cf44  
    1010// Created On       : Sun May 17 09:37:28 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jul 29 16:12:00 2020
    13 // Update Count     : 7
     12// Last Modified On : Thu Aug  8 16:13:00 2019
     13// Update Count     : 6
    1414//
    1515
     
    5151                void postvisit( const ReferenceType * refType );
    5252                void postvisit( const FunctionType * functionType );
     53                void postvisit( const StructInstType * aggregateUseType );
     54                void postvisit( const UnionInstType * aggregateUseType );
    5355                void postvisit( const EnumInstType * aggregateUseType );
    5456                void postvisit( const TraitInstType * aggregateUseType );
     
    7274
    7375// Some function pointer types, differ in return type.
    74 using CostCalculation = std::function<Cost(const ast::Type *, const ast::Type *, bool,
     76using CostCalculation = std::function<Cost(const ast::Type *, const ast::Type *,
    7577        const ast::SymbolTable &, const ast::TypeEnvironment &)>;
    76 using PtrsCalculation = std::function<int(const ast::Type *, const ast::Type *,
     78using NumCostCalculation = std::function<int(const ast::Type *, const ast::Type *,
    7779        const ast::SymbolTable &, const ast::TypeEnvironment &)>;
    7880
     
    8183protected:
    8284        const ast::Type * dst;
    83         bool srcIsLvalue;
    8485        const ast::SymbolTable & symtab;
    8586        const ast::TypeEnvironment & env;
    8687        CostCalculation costCalc;
    8788public:
    88         static size_t traceId;
    8989        Cost cost;
    90         Cost result() { return cost; }
    9190
    92         ConversionCost_new( const ast::Type * dst, bool srcIsLvalue, const ast::SymbolTable & symtab,
     91        ConversionCost_new( const ast::Type * dst, const ast::SymbolTable & symtab,
    9392                        const ast::TypeEnvironment & env, CostCalculation costCalc ) :
    94                 dst( dst ), srcIsLvalue( srcIsLvalue ), symtab( symtab ), env( env ),
    95                 costCalc( costCalc ), cost( Cost::infinity )
     93                dst( dst ), symtab( symtab ), env( env ), costCalc( costCalc ), cost( Cost::infinity )
    9694        {}
    9795
     
    104102        void postvisit( const ast::ReferenceType * refType );
    105103        void postvisit( const ast::FunctionType * functionType );
     104        void postvisit( const ast::StructInstType * structInstType );
     105        void postvisit( const ast::UnionInstType * unionInstType );
    106106        void postvisit( const ast::EnumInstType * enumInstType );
    107107        void postvisit( const ast::TraitInstType * traitInstType );
     
    114114
    115115Cost convertToReferenceCost( const ast::Type * src, const ast::ReferenceType * dest,
    116         bool srcIsLvalue, const ast::SymbolTable & indexer, const ast::TypeEnvironment & env,
    117         PtrsCalculation func );
     116        const ast::SymbolTable & indexer, const ast::TypeEnvironment & env, NumCostCalculation func );
    118117
    119118} // namespace ResolvExpr
Note: See TracChangeset for help on using the changeset viewer.