Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Stmt.hpp

    r37cdd97 r6cebfef  
    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 node_t * mutate(const node_t * node);
     29#define MUTATE_FRIEND \
     30    template<typename node_t> friend node_t * mutate(const node_t * node); \
     31        template<typename node_t> friend node_t * shallowCopy(const node_t * node);
    3032
    3133namespace ast {
     
    412414class ImplicitCtorDtorStmt final : public Stmt {
    413415public:
    414         readonly<Stmt> callStmt;
     416        ptr<Stmt> callStmt;
    415417
    416418        ImplicitCtorDtorStmt( const CodeLocation & loc, const Stmt * callStmt,
     
    421423private:
    422424        ImplicitCtorDtorStmt * clone() const override { return new ImplicitCtorDtorStmt{ *this }; }
     425        MUTATE_FRIEND
     426};
     427
     428/// Mutex Statement
     429class MutexStmt final : public Stmt {
     430public:
     431        ptr<Stmt> stmt;
     432        std::vector<ptr<Expr>> mutexObjs;
     433
     434        MutexStmt( const CodeLocation & loc, const Stmt * stmt,
     435                std::vector<ptr<Expr>> && mutexes, std::vector<Label> && labels = {} )
     436        : Stmt(loc, std::move(labels)), stmt(stmt), mutexObjs(std::move(mutexes)) {}
     437
     438        const Stmt * accept( Visitor & v ) const override { return v.visit( this ); }
     439private:
     440        MutexStmt * clone() const override { return new MutexStmt{ *this }; }
    423441        MUTATE_FRIEND
    424442};
Note: See TracChangeset for help on using the changeset viewer.