Ignore:
Timestamp:
Apr 12, 2024, 3:10:04 PM (2 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
7a36848
Parents:
b78c54f
Message:

Clean-up in the Pass template around call_accept. Removed overloads that no longer contain unique behaviour. Redundent early exits have been removed. Updated the names and removed redundent checks following up the result* type update. New constructors for the delta helper type show how the data is actually used. The differs functions are unused (that value is stored in the result* types).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.proto.hpp

    rb78c54f r90320ac  
    154154                bool is_old;
    155155
    156                 delta(const Stmt * s, ssize_t i, bool old) :
    157                         new_val(s), old_idx(i), is_old(old) {}
     156                explicit delta(const Stmt * s) : new_val(s), old_idx(-1), is_old(false) {}
     157                explicit delta(ssize_t i) : new_val(nullptr), old_idx(i), is_old(true) {}
    158158        };
    159159
     
    188188                std::transform( stmts->begin(), stmts->end(), std::back_inserter( values ),
    189189                        [](ast::ptr<ast::Stmt>& stmt) -> delta {
    190                                 return delta( stmt.release(), -1, false );
     190                                return delta( stmt.release() );
    191191                        });
    192192                stmts->clear();
     
    201201                        [](ast::ptr<ast::Decl>& decl) -> delta {
    202202                                ast::Decl const * d = decl.release();
    203                                 return delta( new DeclStmt( d->location, d ), -1, false );
     203                                return delta( new DeclStmt( d->location, d ) );
    204204                        });
    205205                decls->clear();
Note: See TracChangeset for help on using the changeset viewer.