Changeset c408483


Ignore:
Timestamp:
Jul 28, 2020, 2:37:36 PM (14 months ago)
Author:
Fangren Yu <f37yu@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
eb1be63
Parents:
d1ee9ec
Message:

cleanup

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.hpp

    rd1ee9ec rc408483  
    343343extern struct PassVisitorStats {
    344344        size_t depth = 0;
    345         Stats::Counters::MaxCounter<double> * max = nullptr;
    346         Stats::Counters::AverageCounter<double> * avg = nullptr;
     345        Stats::Counters::MaxCounter<double> * max;
     346        Stats::Counters::AverageCounter<double> * avg;
    347347} pass_visitor_stats;
    348348}
  • src/AST/Pass.proto.hpp

    rd1ee9ec rc408483  
    8484                };
    8585
    86                 std::stack< cleanup_t > cleanups;
     86                std::stack< cleanup_t, std::vector<cleanup_t> > cleanups;
    8787        };
    8888
  • src/Common/PassVisitor.proto.h

    rd1ee9ec rc408483  
    3838        };
    3939
    40         std::stack< cleanup_t > cleanups;
     40        std::stack< cleanup_t, std::vector<cleanup_t> > cleanups;
    4141};
    4242
  • src/ResolvExpr/Resolver.cc

    rd1ee9ec rc408483  
    10721072                /// Strips extraneous casts out of an expression
    10731073                struct StripCasts_new final {
    1074                         const ast::Expr * postmutate( const ast::CastExpr * castExpr ) {
     1074                        const ast::Expr * postvisit( const ast::CastExpr * castExpr ) {
    10751075                                if (
    10761076                                        castExpr->isGenerated == ast::GeneratedCast
  • src/SymTab/FixFunction.cc

    rd1ee9ec rc408483  
    106106                bool isVoid = false;
    107107
    108                 void premutate( const ast::FunctionDecl * ) { visit_children = false; }
     108                void previsit( const ast::FunctionDecl * ) { visit_children = false; }
    109109
    110                 const ast::DeclWithType * postmutate( const ast::FunctionDecl * func ) {
     110                const ast::DeclWithType * postvisit( const ast::FunctionDecl * func ) {
    111111                        return new ast::ObjectDecl{
    112112                                func->location, func->name, new ast::PointerType{ func->type }, nullptr,
     
    114114                }
    115115
    116                 void premutate( const ast::ArrayType * ) { visit_children = false; }
     116                void previsit( const ast::ArrayType * ) { visit_children = false; }
    117117
    118                 const ast::Type * postmutate( const ast::ArrayType * array ) {
     118                const ast::Type * postvisit( const ast::ArrayType * array ) {
    119119                        return new ast::PointerType{
    120120                                array->base, array->dimension, array->isVarLen, array->isStatic,
     
    122122                }
    123123
    124                 void premutate( const ast::VoidType * ) { isVoid = true; }
     124                void previsit( const ast::VoidType * ) { isVoid = true; }
    125125
    126                 void premutate( const ast::BasicType * ) { visit_children = false; }
    127                 void premutate( const ast::PointerType * ) { visit_children = false; }
    128                 void premutate( const ast::StructInstType * ) { visit_children = false; }
    129                 void premutate( const ast::UnionInstType * ) { visit_children = false; }
    130                 void premutate( const ast::EnumInstType * ) { visit_children = false; }
    131                 void premutate( const ast::TraitInstType * ) { visit_children = false; }
    132                 void premutate( const ast::TypeInstType * ) { visit_children = false; }
    133                 void premutate( const ast::TupleType * ) { visit_children = false; }
    134                 void premutate( const ast::VarArgsType * ) { visit_children = false; }
    135                 void premutate( const ast::ZeroType * ) { visit_children = false; }
    136                 void premutate( const ast::OneType * ) { visit_children = false; }
     126                void previsit( const ast::BasicType * ) { visit_children = false; }
     127                void previsit( const ast::PointerType * ) { visit_children = false; }
     128                void previsit( const ast::StructInstType * ) { visit_children = false; }
     129                void previsit( const ast::UnionInstType * ) { visit_children = false; }
     130                void previsit( const ast::EnumInstType * ) { visit_children = false; }
     131                void previsit( const ast::TraitInstType * ) { visit_children = false; }
     132                void previsit( const ast::TypeInstType * ) { visit_children = false; }
     133                void previsit( const ast::TupleType * ) { visit_children = false; }
     134                void previsit( const ast::VarArgsType * ) { visit_children = false; }
     135                void previsit( const ast::ZeroType * ) { visit_children = false; }
     136                void previsit( const ast::OneType * ) { visit_children = false; }
    137137        };
    138138} // anonymous namespace
  • src/Tuples/Explode.cc

    rd1ee9ec rc408483  
    147147        }
    148148
    149         const ast::Expr * postmutate( const ast::UniqueExpr * node ) {
     149        const ast::Expr * postvisit( const ast::UniqueExpr * node ) {
    150150                // move cast into unique expr so that the unique expr has type T& rather than
    151151                // type T. In particular, this transformation helps with generating the
     
    166166        }
    167167
    168         const ast::Expr * postmutate( const ast::TupleIndexExpr * tupleExpr ) {
     168        const ast::Expr * postvisit( const ast::TupleIndexExpr * tupleExpr ) {
    169169                // tuple index expr needs to be rebuilt to ensure that the type of the
    170170                // field is consistent with the type of the tuple expr, since the field
Note: See TracChangeset for help on using the changeset viewer.