- File:
-
- 1 edited
-
src/ResolvExpr/ConversionCost.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cc
r89e6ffc r7e003011 30 30 /// std::cout << "type inst " << destAsTypeInst->get_name(); 31 31 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 32 return conversionCost( src, eqvClass.type, indexer, env ); 32 if ( eqvClass.type ) { 33 return conversionCost( src, eqvClass.type, indexer, env ); 34 } else { 35 return Cost::infinity; 36 } 33 37 } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) { 34 38 /// std::cout << " found" << std::endl; … … 145 149 }; 146 150 147 void ConversionCost::visit( VoidType *voidType) {151 void ConversionCost::visit( __attribute((unused)) VoidType *voidType ) { 148 152 cost = Cost::infinity; 149 153 } … … 182 186 } 183 187 184 void ConversionCost::visit(ArrayType *arrayType) { 185 } 186 187 void ConversionCost::visit(FunctionType *functionType) { 188 } 188 void ConversionCost::visit(__attribute((unused)) ArrayType *arrayType) {} 189 void ConversionCost::visit(__attribute((unused)) FunctionType *functionType) {} 189 190 190 191 void ConversionCost::visit(StructInstType *inst) { … … 204 205 } 205 206 206 void ConversionCost::visit( EnumInstType *inst) {207 void ConversionCost::visit( __attribute((unused)) EnumInstType *inst ) { 207 208 static Type::Qualifiers q; 208 209 static BasicType integer( q, BasicType::SignedInt ); … … 213 214 } 214 215 215 void ConversionCost::visit( TraitInstType *inst) {216 void ConversionCost::visit( __attribute((unused)) TraitInstType *inst) { 216 217 } 217 218 … … 235 236 } 236 237 237 void ConversionCost::visit( TupleType *tupleType) {238 void ConversionCost::visit( __attribute((unused)) TupleType *tupleType) { 238 239 Cost c; 239 240 if ( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) { 240 241 std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin(); 241 242 std::list< Type* >::const_iterator destIt = destAsTuple->get_types().begin(); 242 while ( srcIt != tupleType->get_types().end() ) {243 while ( srcIt != tupleType->get_types().end() && destIt != destAsTuple->get_types().end() ) { 243 244 Cost newCost = conversionCost( *srcIt++, *destIt++, indexer, env ); 244 245 if ( newCost == Cost::infinity ) { … … 255 256 } 256 257 257 void ConversionCost::visit( VarArgsType *varArgsType) {258 void ConversionCost::visit( __attribute((unused)) VarArgsType *varArgsType) { 258 259 if ( dynamic_cast< VarArgsType* >( dest ) ) { 259 260 cost = Cost::zero; … … 261 262 } 262 263 263 void ConversionCost::visit( ZeroType *zeroType) {264 void ConversionCost::visit( __attribute((unused)) ZeroType *zeroType) { 264 265 if ( dynamic_cast< ZeroType* >( dest ) ) { 265 266 cost = Cost::zero; … … 277 278 } 278 279 279 void ConversionCost::visit( OneType *oneType) {280 void ConversionCost::visit( __attribute((unused)) OneType *oneType) { 280 281 if ( dynamic_cast< OneType* >( dest ) ) { 281 282 cost = Cost::zero;
Note:
See TracChangeset
for help on using the changeset viewer.