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