Changeset 8f7cea1 for src/ResolvExpr
- Timestamp:
- Sep 11, 2016, 9:58:25 AM (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:
- 6eb8948
- Parents:
- 908cc83
- git-author:
- Rob Schluntz <rschlunt@…> (09/11/16 09:56:02)
- git-committer:
- Rob Schluntz <rschlunt@…> (09/11/16 09:58:25)
- Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
r908cc83 r8f7cea1 39 39 #include "SymTab/Validate.h" 40 40 #include "Tuples/TupleAssignment.h" 41 #include "Tuples/NameMatcher.h"42 41 #include "Common/utility.h" 43 42 #include "InitTweak/InitTweak.h" … … 265 264 266 265 Cost computeConversionCost( Alternative &alt, const SymTab::Indexer &indexer ) { 267 ApplicationExpr *appExpr = dynamic_cast< ApplicationExpr* >( alt.expr ); 268 assert( appExpr ); 269 PointerType *pointer = dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() ); 270 assert( pointer ); 271 FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ); 272 assert( function ); 266 ApplicationExpr *appExpr = safe_dynamic_cast< ApplicationExpr* >( alt.expr ); 267 PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() ); 268 FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() ); 273 269 274 270 Cost convCost( 0, 0, 0 ); … … 397 393 resultEnv.extractOpenVars( openVars ); 398 394 399 /*400 Tuples::NameMatcher matcher( formals );401 try {402 matcher.match( actuals );403 } catch ( Tuples::NoMatch &e ) {404 std::cerr << "Alternative doesn't match: " << e.message << std::endl;405 }406 */407 395 std::list< DeclarationWithType* >::iterator formal = formals.begin(); 408 396 … … 707 695 708 696 PRINT( 709 ApplicationExpr *appExpr = dynamic_cast< ApplicationExpr* >( withFunc->expr ); 710 assert( appExpr ); 711 PointerType *pointer = dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() ); 712 assert( pointer ); 713 FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ); 714 assert( function ); 697 ApplicationExpr *appExpr = safe_dynamic_cast< ApplicationExpr* >( withFunc->expr ); 698 PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() ); 699 FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() ); 715 700 std::cerr << "Case +++++++++++++" << std::endl; 716 701 std::cerr << "formals are:" << std::endl; … … 1068 1053 } 1069 1054 } 1055 1056 void AlternativeFinder::visit( TupleIndexExpr *tupleExpr ) { 1057 alternatives.push_back( Alternative( tupleExpr->clone(), env, Cost::zero ) ); 1058 } 1070 1059 } // namespace ResolvExpr 1071 1060 -
src/ResolvExpr/AlternativeFinder.h
r908cc83 r8f7cea1 67 67 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ); 68 68 virtual void visit( ConstructorExpr * ctorExpr ); 69 virtual void visit( TupleIndexExpr *tupleExpr ); 69 70 /// Runs a new alternative finder on each element in [begin, end) 70 71 /// and writes each alternative finder to out.
Note: See TracChangeset
for help on using the changeset viewer.