Changeset 9ea38de for src/ResolvExpr


Ignore:
Timestamp:
Jun 25, 2019, 11:26:30 AM (5 years ago)
Author:
Aaron Moss <a3moss@…>
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
Message:

Fix ast::Pass guard classes

Location:
src/ResolvExpr
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AdjustExprType.cc

    r28af389 r9ea38de  
    100100
    101101namespace {
    102         struct AdjustExprType_new final : public ast::WithShortCircuiting {
     102        class AdjustExprType_new final : public ast::WithShortCircuiting {
     103                const ast::SymbolTable & symtab;
     104        public:
    103105                const ast::TypeEnvironment & tenv;
    104                 const ast::SymbolTable & symtab;
    105106
    106107                AdjustExprType_new( const ast::TypeEnvironment & e, const ast::SymbolTable & syms )
    107                 : tenv( e ), symtab( syms ) {}
     108                : symtab( syms ), tenv( e ) {}
    108109
    109110                void premutate( const ast::VoidType * ) { visit_children = false; }
  • src/ResolvExpr/CandidateFinder.cpp

    r28af389 r9ea38de  
    594594
    595595        /// 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:
    597599                CandidateFinder & selfFinder;
    598                 const ast::SymbolTable & symtab;
    599600                CandidateList & candidates;
    600601                const ast::TypeEnvironment & tenv;
     
    602603
    603604                Finder( CandidateFinder & f )
    604                 : selfFinder( f ), symtab( f.symtab ), candidates( f.candidates ), tenv( f.env ),
     605                : symtab( f.localSyms ), selfFinder( f ), candidates( f.candidates ), tenv( f.env ),
    605606                  targetType( f.targetType ) {}
    606607               
     
    15581559                std::vector< std::string > errors;
    15591560                for ( CandidateRef & candidate : candidates ) {
    1560                         satisfyAssertions( candidate, symtab, satisfied, errors );
     1561                        satisfyAssertions( candidate, localSyms, satisfied, errors );
    15611562                }
    15621563
     
    16131614                        r->expr = ast::mutate_field(
    16141615                                r->expr.get(), &ast::Expr::result,
    1615                                 adjustExprType( r->expr->result, r->env, symtab ) );
     1616                                adjustExprType( r->expr->result, r->env, localSyms ) );
    16161617                }
    16171618        }
     
    16311632
    16321633        for ( const auto & x : xs ) {
    1633                 out.emplace_back( symtab, env );
     1634                out.emplace_back( localSyms, env );
    16341635                out.back().find( x, ResolvMode::withAdjustment() );
    16351636               
  • src/ResolvExpr/CandidateFinder.hpp

    r28af389 r9ea38de  
    2828struct CandidateFinder {
    2929        CandidateList candidates;          ///< List of candidate resolutions
    30         const ast::SymbolTable & symtab;   ///< Symbol table to lookup candidates
     30        const ast::SymbolTable & localSyms;   ///< Symbol table to lookup candidates
    3131        const ast::TypeEnvironment & env;  ///< Substitutions performed in this resolution
    3232        ast::ptr< ast::Type > targetType;  ///< Target type for resolution
    3333
    3434        CandidateFinder(
    35                 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env,
     35                const ast::SymbolTable & syms, const ast::TypeEnvironment & env,
    3636                const ast::Type * tt = nullptr )
    37         : candidates(), symtab( symtab ), env( env ), targetType( tt ) {}
     37        : candidates(), localSyms( syms ), env( env ), targetType( tt ) {}
    3838
    3939        /// Fill candidates with feasible resolutions for `expr`
  • src/ResolvExpr/PolyCost.cc

    r28af389 r9ea38de  
    5858
    5959// TODO: When the old PolyCost is torn out get rid of the _new suffix.
    60 struct PolyCost_new {
     60class PolyCost_new {
     61        const ast::SymbolTable &symtab;
     62public:
    6163        int result;
    62         const ast::SymbolTable &symtab;
    6364        const ast::TypeEnvironment &env_;
    6465
    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 ) {}
    6768
    6869        void previsit( const ast::TypeInstType * type ) {
Note: See TracChangeset for help on using the changeset viewer.