Changeset 8f7cea1 for src/ResolvExpr


Ignore:
Timestamp:
Sep 11, 2016, 9:58:25 AM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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)
Message:

remove NameMatcher? code

Location:
src/ResolvExpr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r908cc83 r8f7cea1  
    3939#include "SymTab/Validate.h"
    4040#include "Tuples/TupleAssignment.h"
    41 #include "Tuples/NameMatcher.h"
    4241#include "Common/utility.h"
    4342#include "InitTweak/InitTweak.h"
     
    265264
    266265        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() );
    273269
    274270                Cost convCost( 0, 0, 0 );
     
    397393                resultEnv.extractOpenVars( openVars );
    398394
    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                 */
    407395                std::list< DeclarationWithType* >::iterator formal = formals.begin();
    408396
     
    707695
    708696                        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() );
    715700                                std::cerr << "Case +++++++++++++" << std::endl;
    716701                                std::cerr << "formals are:" << std::endl;
     
    10681053                }
    10691054        }
     1055
     1056        void AlternativeFinder::visit( TupleIndexExpr *tupleExpr ) {
     1057                alternatives.push_back( Alternative( tupleExpr->clone(), env, Cost::zero ) );
     1058        }
    10701059} // namespace ResolvExpr
    10711060
  • src/ResolvExpr/AlternativeFinder.h

    r908cc83 r8f7cea1  
    6767                virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr );
    6868                virtual void visit( ConstructorExpr * ctorExpr );
     69                virtual void visit( TupleIndexExpr *tupleExpr );
    6970                /// Runs a new alternative finder on each element in [begin, end)
    7071                /// and writes each alternative finder to out.
Note: See TracChangeset for help on using the changeset viewer.