Changeset 9ea38de for src/ResolvExpr
- Timestamp:
- Jun 25, 2019, 11:26:30 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- bcb311b
- Parents:
- 28af389
- Location:
- src/ResolvExpr
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AdjustExprType.cc
r28af389 r9ea38de 100 100 101 101 namespace { 102 struct AdjustExprType_new final : public ast::WithShortCircuiting { 102 class AdjustExprType_new final : public ast::WithShortCircuiting { 103 const ast::SymbolTable & symtab; 104 public: 103 105 const ast::TypeEnvironment & tenv; 104 const ast::SymbolTable & symtab;105 106 106 107 AdjustExprType_new( const ast::TypeEnvironment & e, const ast::SymbolTable & syms ) 107 : tenv( e ), symtab( syms) {}108 : symtab( syms ), tenv( e ) {} 108 109 109 110 void premutate( const ast::VoidType * ) { visit_children = false; } -
src/ResolvExpr/CandidateFinder.cpp
r28af389 r9ea38de 594 594 595 595 /// Actually visits expressions to find their candidate interpretations 596 struct Finder final : public ast::WithShortCircuiting { 596 class Finder final : public ast::WithShortCircuiting { 597 const ast::SymbolTable & symtab; 598 public: 597 599 CandidateFinder & selfFinder; 598 const ast::SymbolTable & symtab;599 600 CandidateList & candidates; 600 601 const ast::TypeEnvironment & tenv; … … 602 603 603 604 Finder( CandidateFinder & f ) 604 : s elfFinder( f ), symtab( f.symtab), candidates( f.candidates ), tenv( f.env ),605 : symtab( f.localSyms ), selfFinder( f ), candidates( f.candidates ), tenv( f.env ), 605 606 targetType( f.targetType ) {} 606 607 … … 1558 1559 std::vector< std::string > errors; 1559 1560 for ( CandidateRef & candidate : candidates ) { 1560 satisfyAssertions( candidate, symtab, satisfied, errors );1561 satisfyAssertions( candidate, localSyms, satisfied, errors ); 1561 1562 } 1562 1563 … … 1613 1614 r->expr = ast::mutate_field( 1614 1615 r->expr.get(), &ast::Expr::result, 1615 adjustExprType( r->expr->result, r->env, symtab) );1616 adjustExprType( r->expr->result, r->env, localSyms ) ); 1616 1617 } 1617 1618 } … … 1631 1632 1632 1633 for ( const auto & x : xs ) { 1633 out.emplace_back( symtab, env );1634 out.emplace_back( localSyms, env ); 1634 1635 out.back().find( x, ResolvMode::withAdjustment() ); 1635 1636 -
src/ResolvExpr/CandidateFinder.hpp
r28af389 r9ea38de 28 28 struct CandidateFinder { 29 29 CandidateList candidates; ///< List of candidate resolutions 30 const ast::SymbolTable & symtab; ///< Symbol table to lookup candidates30 const ast::SymbolTable & localSyms; ///< Symbol table to lookup candidates 31 31 const ast::TypeEnvironment & env; ///< Substitutions performed in this resolution 32 32 ast::ptr< ast::Type > targetType; ///< Target type for resolution 33 33 34 34 CandidateFinder( 35 const ast::SymbolTable & sym tab, const ast::TypeEnvironment & env,35 const ast::SymbolTable & syms, const ast::TypeEnvironment & env, 36 36 const ast::Type * tt = nullptr ) 37 : candidates(), symtab( symtab), env( env ), targetType( tt ) {}37 : candidates(), localSyms( syms ), env( env ), targetType( tt ) {} 38 38 39 39 /// Fill candidates with feasible resolutions for `expr` -
src/ResolvExpr/PolyCost.cc
r28af389 r9ea38de 58 58 59 59 // TODO: When the old PolyCost is torn out get rid of the _new suffix. 60 struct PolyCost_new { 60 class PolyCost_new { 61 const ast::SymbolTable &symtab; 62 public: 61 63 int result; 62 const ast::SymbolTable &symtab;63 64 const ast::TypeEnvironment &env_; 64 65 65 PolyCost_new( const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ) :66 result( 0 ), symtab( symtab), env_( env ) {}66 PolyCost_new( const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ) 67 : symtab( symtab ), result( 0 ), env_( env ) {} 67 68 68 69 void previsit( const ast::TypeInstType * type ) {
Note: See TracChangeset
for help on using the changeset viewer.