Changeset 0b150ec for src/ResolvExpr
- Timestamp:
- May 24, 2017, 4:12:28 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 7f623d6f
- Parents:
- 6e206cb
- Location:
- src/ResolvExpr
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CastCost.cc
r6e206cb r0b150ec 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // CastCost.cc -- 7 // CastCost.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 26 26 public: 27 27 CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 28 28 29 29 virtual void visit( BasicType *basicType ); 30 30 virtual void visit( PointerType *pointerType ); … … 36 36 NamedTypeDecl *namedType; 37 37 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 38 return castCost( src, eqvClass.type, indexer, env ); 38 if ( eqvClass.type ) { 39 return castCost( src, eqvClass.type, indexer, env ); 40 } else { 41 return Cost::infinity; 42 } 39 43 } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) { 40 44 TypeDecl *type = dynamic_cast< TypeDecl* >( namedType ); -
src/ResolvExpr/ConversionCost.cc
r6e206cb r0b150ec 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; -
src/ResolvExpr/Resolver.cc
r6e206cb r0b150ec 124 124 } // if 125 125 #endif 126 assert ( finder.get_alternatives().size() == 1);126 assertf( finder.get_alternatives().size() == 1, "findSingleExpression: must have exactly one alternative at the end." ); 127 127 Alternative &choice = finder.get_alternatives().front(); 128 128 Expression *newExpr = choice.expr->clone(); … … 397 397 // // cerr << type << endl; 398 398 // // } // for 399 399 400 400 // // O(N^2) checks of d-types with f-types 401 401 // // find the minimum cost -
src/ResolvExpr/Unify.cc
r6e206cb r0b150ec 344 344 std::cerr << "unifyInexact type 1 is "; 345 345 type1->print( std::cerr ); 346 std::cerr << " type 2 is ";346 std::cerr << " type 2 is "; 347 347 type2->print( std::cerr ); 348 348 std::cerr << std::endl; … … 595 595 TypeExpr *otherParam = dynamic_cast< TypeExpr* >(*jt); 596 596 assertf(otherParam, "Aggregate parameters should be type expressions"); 597 597 598 598 Type* paramTy = param->get_type(); 599 599 Type* otherParamTy = otherParam->get_type();
Note: See TracChangeset
for help on using the changeset viewer.