Changeset 7870799 for src/ResolvExpr/ConversionCost.h
- Timestamp:
- Jul 12, 2019, 10:49:02 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- ef5b828
- Parents:
- ee6dbae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.h
ree6dbae r7870799 33 33 class TypeEnvironment; 34 34 35 typedef std::function<Cost( Type *,Type *, const SymTab::Indexer &, const TypeEnvironment &)> CostFunction;35 typedef std::function<Cost(const Type *, const Type *, const SymTab::Indexer &, const TypeEnvironment &)> CostFunction; 36 36 struct ConversionCost : public WithShortCircuiting { 37 37 public: 38 ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction );38 ConversionCost( const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction ); 39 39 40 40 Cost get_cost() const { return cost; } 41 41 42 void previsit( BaseSyntaxNode * ) { visit_children = false; }42 void previsit( const BaseSyntaxNode * ) { visit_children = false; } 43 43 44 void postvisit( VoidType * voidType );45 void postvisit( BasicType * basicType );46 void postvisit( PointerType * pointerType );47 void postvisit( ArrayType * arrayType );48 void postvisit( ReferenceType * refType );49 void postvisit( FunctionType * functionType );50 void postvisit( StructInstType * aggregateUseType );51 void postvisit( UnionInstType * aggregateUseType );52 void postvisit( EnumInstType * aggregateUseType );53 void postvisit( TraitInstType * aggregateUseType );54 void postvisit( TypeInstType * aggregateUseType );55 void postvisit( TupleType * tupleType );56 void postvisit( VarArgsType * varArgsType );57 void postvisit( ZeroType * zeroType );58 void postvisit( OneType * oneType );44 void postvisit( const VoidType * voidType ); 45 void postvisit( const BasicType * basicType ); 46 void postvisit( const PointerType * pointerType ); 47 void postvisit( const ArrayType * arrayType ); 48 void postvisit( const ReferenceType * refType ); 49 void postvisit( const FunctionType * functionType ); 50 void postvisit( const StructInstType * aggregateUseType ); 51 void postvisit( const UnionInstType * aggregateUseType ); 52 void postvisit( const EnumInstType * aggregateUseType ); 53 void postvisit( const TraitInstType * aggregateUseType ); 54 void postvisit( const TypeInstType * aggregateUseType ); 55 void postvisit( const TupleType * tupleType ); 56 void postvisit( const VarArgsType * varArgsType ); 57 void postvisit( const ZeroType * zeroType ); 58 void postvisit( const OneType * oneType ); 59 59 protected: 60 Type *dest;60 const Type * dest; 61 61 const SymTab::Indexer &indexer; 62 62 Cost cost; … … 65 65 }; 66 66 67 typedef std::function<int( Type *,Type *, const SymTab::Indexer &, const TypeEnvironment &)> PtrsFunction;68 Cost convertToReferenceCost( Type * src,ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func );67 typedef std::function<int(const Type *, const Type *, const SymTab::Indexer &, const TypeEnvironment &)> PtrsFunction; 68 Cost convertToReferenceCost( const Type * src, const ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ); 69 69 70 70 // Some function pointer types, differ in return type.
Note: See TracChangeset
for help on using the changeset viewer.