Changeset 0bd3faf for src/ResolvExpr/CastCost.cc
- Timestamp:
- Nov 13, 2023, 1:40:12 PM (11 months ago)
- Branches:
- master
- Children:
- 6ea85b22
- Parents:
- 25f2798
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CastCost.cc
r25f2798 r0bd3faf 26 26 #include "ResolvExpr/ConversionCost.h" // for conversionCost 27 27 #include "ResolvExpr/PtrsCastable.hpp" // for ptrsCastable 28 #include "ResolvExpr/typeops.h" // for ptrsCastable29 28 #include "ResolvExpr/Unify.h" // for typesCompatibleIgnoreQualifiers 30 29 … … 38 37 39 38 namespace { 40 struct CastCost _new : public ConversionCost_new{41 using ConversionCost _new::previsit;42 using ConversionCost _new::postvisit;39 struct CastCost : public ConversionCost { 40 using ConversionCost::previsit; 41 using ConversionCost::postvisit; 43 42 44 CastCost _new(43 CastCost( 45 44 const ast::Type * dst, bool srcIsLvalue, const ast::SymbolTable & symtab, 46 45 const ast::TypeEnvironment & env, CostCalculation costFunc ) 47 : ConversionCost _new( dst, srcIsLvalue, symtab, env, costFunc ) {}46 : ConversionCost( dst, srcIsLvalue, symtab, env, costFunc ) {} 48 47 49 48 void postvisit( const ast::BasicType * basicType ) { … … 85 84 }; 86 85 87 #warning For overload resolution between the two versions.88 int localPtrsCastable(const ast::Type * t1, const ast::Type * t2,89 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ) {90 return ptrsCastable( t1, t2, symtab, env );91 }92 Cost localCastCost(93 const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,94 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env95 ) { return castCost( src, dst, srcIsLvalue, symtab, env ); }96 86 } // anonymous namespace 97 87 … … 136 126 } else if ( auto refType = dynamic_cast< const ast::ReferenceType * >( dst ) ) { 137 127 PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; ) 138 #warning cast on ptrsCastable artifact of having two functions, remove when port done139 128 return convertToReferenceCost( 140 src, refType, srcIsLvalue, symtab, env, localPtrsCastable );129 src, refType, srcIsLvalue, symtab, env, ptrsCastable ); 141 130 } else { 142 #warning cast on castCost artifact of having two functions, remove when port done 143 ast::Pass< CastCost_new > converter( 144 dst, srcIsLvalue, symtab, env, localCastCost ); 131 ast::Pass< CastCost > converter( 132 dst, srcIsLvalue, symtab, env, castCost ); 145 133 src->accept( converter ); 146 134 return converter.core.cost;
Note: See TracChangeset
for help on using the changeset viewer.