Changeset 246c245 for src/AST/Stmt.hpp


Ignore:
Timestamp:
May 16, 2019, 6:51:18 PM (5 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8ff178d, d66e7b7
Parents:
9b4f329 (diff), 6f8e87d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Stmt.hpp

    r9b4f329 r246c245  
    1010// Created On       : Wed May  8 13:00:00 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed May 15 16:01:00 2019
    13 // Update Count     : 2
     12// Last Modified On : Wed May 16 12:20:00 2019
     13// Update Count     : 3
    1414//
    1515
     
    2727
    2828// Must be included in *all* AST classes; should be #undef'd at the end of the file
    29 #define MUTATE_FRIEND template<typename node_t> friend auto mutate(const node_t * node);
     29#define MUTATE_FRIEND template<typename node_t> friend node_t * mutate(const node_t * node);
    3030
    3131namespace ast {
     
    8686        ptr<Expr> expr;
    8787
    88         ExprStmt( const CodeLocation & loc, const Expr * e ) : Stmt(loc), expr(e) {}
     88        ExprStmt( const CodeLocation& loc, const Expr* e, std::vector<Label>&& labels = {} )
     89        : Stmt(loc, std::move(labels)), expr(e) {}
    8990
    9091        const Stmt * accept( Visitor & v ) const override { return v.visit( this ); }
     
    404405};
    405406
    406 //=================================================================================================
    407 /// This disgusting and giant piece of boiler-plate is here to solve a cyclic dependency
    408 /// remove only if there is a better solution
    409 /// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with
    410 /// forward declarations
    411 inline void increment( const class Stmt * node, Node::ref_type ref ) { node->increment( ref ); }
    412 inline void decrement( const class Stmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    413 inline void increment( const class CompoundStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    414 inline void decrement( const class CompoundStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    415 inline void increment( const class ExprStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    416 inline void decrement( const class ExprStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    417 inline void increment( const class AsmStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    418 inline void decrement( const class AsmStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    419 inline void increment( const class DirectiveStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    420 inline void decrement( const class DirectiveStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    421 inline void increment( const class IfStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    422 inline void decrement( const class IfStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    423 inline void increment( const class WhileStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    424 inline void decrement( const class WhileStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    425 inline void increment( const class ForStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    426 inline void decrement( const class ForStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    427 inline void increment( const class SwitchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    428 inline void decrement( const class SwitchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    429 inline void increment( const class CaseStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    430 inline void decrement( const class CaseStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    431 inline void increment( const class BranchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    432 inline void decrement( const class BranchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    433 inline void increment( const class ReturnStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    434 inline void decrement( const class ReturnStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    435 inline void increment( const class ThrowStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    436 inline void decrement( const class ThrowStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    437 inline void increment( const class TryStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    438 inline void decrement( const class TryStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    439 inline void increment( const class CatchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    440 inline void decrement( const class CatchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    441 inline void increment( const class FinallyStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    442 inline void decrement( const class FinallyStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    443 inline void increment( const class WaitForStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    444 inline void decrement( const class WaitForStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    445 inline void increment( const class WithStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    446 inline void decrement( const class WithStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    447 inline void increment( const class DeclStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    448 inline void decrement( const class DeclStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    449 inline void increment( const class NullStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    450 inline void decrement( const class NullStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    451 inline void increment( const class ImplicitCtorDtorStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    452 inline void decrement( const class ImplicitCtorDtorStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    453 
    454407}
    455408
Note: See TracChangeset for help on using the changeset viewer.