Changes in src/AST/Stmt.hpp [f3cc5b6:87701b6]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Stmt.hpp
rf3cc5b6 r87701b6 26 26 #include "Common/CodeLocation.h" 27 27 28 // Must be included in *all* AST classes; should be #undef'd at the end of the file29 #define MUTATE_FRIEND template<typename node_t> friend auto mutate(const node_t * node);30 31 28 namespace ast { 32 29 … … 38 35 std::vector<Label> labels; 39 36 40 Stmt( const CodeLocation & loc, std::vector<Label>&& labels = {} )37 Stmt( const CodeLocation& loc, std::vector<Label>&& labels = {} ) 41 38 : ParseNode(loc), labels(std::move(labels)) {} 42 39 43 40 Stmt(const Stmt& o) : ParseNode(o), labels(o.labels) {} 44 41 45 const Stmt * accept( Visitor & v ) const override = 0; 46 private: 47 Stmt * clone() const override = 0; 48 MUTATE_FRIEND 42 const Stmt* accept( Visitor& v ) const override = 0; 43 private: 44 Stmt* clone() const override = 0; 49 45 }; 50 46 … … 54 50 std::list<ptr<Stmt>> kids; 55 51 56 CompoundStmt(const CodeLocation & loc, std::list<ptr<Stmt>>&& ks = {} )52 CompoundStmt(const CodeLocation& loc, std::list<ptr<Stmt>>&& ks = {} ) 57 53 : Stmt(loc), kids(std::move(ks)) {} 58 54 … … 60 56 CompoundStmt( CompoundStmt&& o ) = default; 61 57 62 void push_back( Stmt * s ) { kids.emplace_back( s ); } 63 void push_front( Stmt * s ) { kids.emplace_front( s ); } 64 65 const CompoundStmt * accept( Visitor & v ) const override { return v.visit( this ); } 66 private: 67 CompoundStmt * clone() const override { return new CompoundStmt{ *this }; } 68 MUTATE_FRIEND 58 void push_back( Stmt* s ) { kids.emplace_back( s ); } 59 void push_front( Stmt* s ) { kids.emplace_front( s ); } 60 61 const CompoundStmt* accept( Visitor& v ) const override { return v.visit( this ); } 62 private: 63 CompoundStmt* clone() const override { return new CompoundStmt{ *this }; } 64 65 /// Must be copied in ALL derived classes 66 template<typename node_t> 67 friend node_t * mutate(const node_t * node); 69 68 }; 70 69 … … 72 71 class NullStmt final : public Stmt { 73 72 public: 74 NullStmt( const CodeLocation & loc, std::vector<Label>&& labels = {} )73 NullStmt( const CodeLocation& loc, std::vector<Label>&& labels = {} ) 75 74 : Stmt(loc, std::move(labels)) {} 76 75 77 const NullStmt * accept( Visitor & v ) const override { return v.visit( this ); } 78 private: 79 NullStmt * clone() const override { return new NullStmt{ *this }; } 80 MUTATE_FRIEND 76 const NullStmt* accept( Visitor& v ) const override { return v.visit( this ); } 77 private: 78 NullStmt* clone() const override { return new NullStmt{ *this }; } 79 80 /// Must be copied in ALL derived classes 81 template<typename node_t> 82 friend node_t * mutate(const node_t * node); 81 83 }; 82 84 … … 88 90 ExprStmt( const CodeLocation & loc, const Expr * e ) : Stmt(loc), expr(e) {} 89 91 90 const Stmt * accept( Visitor 92 const Stmt * accept( Visitor& v ) const override { return v.visit( this ); } 91 93 private: 92 94 ExprStmt * clone() const override { return new ExprStmt{ *this }; } 93 MUTATE_FRIEND 95 96 /// Must be copied in ALL derived classes 97 template<typename node_t> 98 friend node_t * mutate(const node_t * node); 94 99 }; 95 100 … … 102 107 std::vector<Label> gotoLabels; 103 108 104 AsmStmt( const CodeLocation 105 std::vector<ptr<Expr>> && output, std::vector<ptr<Expr>>&& input,106 std::vector<ptr<ConstantExpr>> && clobber, std::vector<Label>&& gotoLabels,107 std::vector<Label> 109 AsmStmt( const CodeLocation& loc, bool isVolatile, const Expr * instruction, 110 std::vector<ptr<Expr>>&& output, std::vector<ptr<Expr>>&& input, 111 std::vector<ptr<ConstantExpr>>&& clobber, std::vector<Label>&& gotoLabels, 112 std::vector<Label>&& labels = {}) 108 113 : Stmt(loc, std::move(labels)), isVolatile(isVolatile), instruction(instruction), 109 114 output(std::move(output)), input(std::move(input)), clobber(std::move(clobber)), 110 115 gotoLabels(std::move(gotoLabels)) {} 111 116 112 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 113 private: 114 AsmStmt * clone() const override { return new AsmStmt{ *this }; } 115 MUTATE_FRIEND 117 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 118 private: 119 AsmStmt* clone() const override { return new AsmStmt{ *this }; } 120 121 /// Must be copied in ALL derived classes 122 template<typename node_t> 123 friend node_t * mutate(const node_t * node); 116 124 }; 117 125 … … 120 128 std::string directive; 121 129 122 DirectiveStmt( const CodeLocation 123 std::vector<Label> 130 DirectiveStmt( const CodeLocation& loc, const std::string & directive, 131 std::vector<Label>&& labels = {} ) 124 132 : Stmt(loc, std::move(labels)), directive(directive) {} 125 133 126 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 127 private: 128 DirectiveStmt * clone() const override { return new DirectiveStmt{ *this }; } 129 MUTATE_FRIEND 134 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 135 private: 136 DirectiveStmt* clone() const override { return new DirectiveStmt{ *this }; } 137 138 /// Must be copied in ALL derived classes 139 template<typename node_t> 140 friend node_t * mutate(const node_t * node); 130 141 }; 131 142 … … 137 148 std::vector<ptr<Stmt>> inits; 138 149 139 IfStmt( const CodeLocation & loc, const Expr * cond, const Stmt* thenPart,140 Stmt * const elsePart, std::vector<ptr<Stmt>> 141 std::vector<Label> 150 IfStmt( const CodeLocation& loc, const Expr* cond, const Stmt* thenPart, 151 Stmt * const elsePart, std::vector<ptr<Stmt>>&& inits, 152 std::vector<Label>&& labels = {} ) 142 153 : Stmt(loc, std::move(labels)), cond(cond), thenPart(thenPart), elsePart(elsePart), 143 154 inits(std::move(inits)) {} 144 155 145 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 146 private: 147 IfStmt * clone() const override { return new IfStmt{ *this }; } 148 MUTATE_FRIEND 156 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 157 private: 158 IfStmt* clone() const override { return new IfStmt{ *this }; } 159 160 /// Must be copied in ALL derived classes 161 template<typename node_t> 162 friend node_t * mutate(const node_t * node); 149 163 }; 150 164 … … 154 168 std::vector<ptr<Stmt>> stmts; 155 169 156 SwitchStmt( const CodeLocation & loc, const Expr * cond, std::vector<ptr<Stmt>>&& stmts,157 std::vector<Label> 170 SwitchStmt( const CodeLocation& loc, const Expr* cond, std::vector<ptr<Stmt>>&& stmts, 171 std::vector<Label>&& labels = {} ) 158 172 : Stmt(loc, std::move(labels)), cond(cond), stmts(std::move(stmts)) {} 159 173 160 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 161 private: 162 SwitchStmt * clone() const override { return new SwitchStmt{ *this }; } 163 MUTATE_FRIEND 174 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 175 private: 176 SwitchStmt* clone() const override { return new SwitchStmt{ *this }; } 177 178 /// Must be copied in ALL derived classes 179 template<typename node_t> 180 friend node_t * mutate(const node_t * node); 164 181 }; 165 182 … … 169 186 std::vector<ptr<Stmt>> stmts; 170 187 171 CaseStmt( const CodeLocation & loc, const Expr * cond, std::vector<ptr<Stmt>>&& stmts,172 std::vector<Label>&& labels = {} )173 188 CaseStmt( const CodeLocation& loc, const Expr* cond, std::vector<ptr<Stmt>>&& stmts, 189 std::vector<Label>&& labels = {} ) 190 : Stmt(loc, std::move(labels)), cond(cond), stmts(std::move(stmts)) {} 174 191 175 192 bool isDefault() { return !cond; } 176 193 177 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 178 private: 179 CaseStmt * clone() const override { return new CaseStmt{ *this }; } 180 MUTATE_FRIEND 194 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 195 private: 196 CaseStmt* clone() const override { return new CaseStmt{ *this }; } 197 198 /// Must be copied in ALL derived classes 199 template<typename node_t> 200 friend node_t * mutate(const node_t * node); 181 201 }; 182 202 … … 188 208 bool isDoWhile; 189 209 190 WhileStmt( const CodeLocation & loc, const Expr * cond, const Stmt* body,191 std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, std::vector<Label>&& labels = {} )210 WhileStmt( const CodeLocation& loc, const Expr* cond, const Stmt* body, 211 std::vector<ptr<Stmt>>&& inits, bool isDoWhile = false, std::vector<Label>&& labels = {} ) 192 212 : Stmt(loc, std::move(labels)), cond(cond), body(body), inits(std::move(inits)), 193 213 isDoWhile(isDoWhile) {} 194 214 195 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 196 private: 197 WhileStmt * clone() const override { return new WhileStmt{ *this }; } 198 MUTATE_FRIEND 215 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 216 private: 217 WhileStmt* clone() const override { return new WhileStmt{ *this }; } 218 219 /// Must be copied in ALL derived classes 220 template<typename node_t> 221 friend node_t * mutate(const node_t * node); 199 222 }; 200 223 … … 206 229 ptr<Stmt> body; 207 230 208 ForStmt( const CodeLocation & loc, std::vector<ptr<Stmt>> && inits, const Expr* cond,209 const Expr * inc, const Stmt * body, std::vector<Label>&& labels = {} )231 ForStmt( const CodeLocation& loc, std::vector<ptr<Stmt>>&& inits, const Expr* cond, 232 const Expr* inc, const Stmt* body, std::vector<Label>&& labels = {} ) 210 233 : Stmt(loc, std::move(labels)), inits(std::move(inits)), cond(cond), inc(inc), 211 234 body(body) {} 212 235 213 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 214 private: 215 ForStmt * clone() const override { return new ForStmt{ *this }; } 216 MUTATE_FRIEND 236 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 237 private: 238 ForStmt* clone() const override { return new ForStmt{ *this }; } 239 240 /// Must be copied in ALL derived classes 241 template<typename node_t> 242 friend node_t * mutate(const node_t * node); 217 243 }; 218 244 … … 227 253 Kind kind; 228 254 229 BranchStmt( const CodeLocation 230 std::vector<Label> 231 BranchStmt( const CodeLocation & loc, const Expr* computedTarget,232 std::vector<Label> 255 BranchStmt( const CodeLocation& loc, Kind kind, Label target, 256 std::vector<Label>&& labels = {} ); 257 BranchStmt( const CodeLocation& loc, const Expr* computedTarget, 258 std::vector<Label>&& labels = {} ) 233 259 : Stmt(loc, std::move(labels)), originalTarget(loc), target(loc), 234 260 computedTarget(computedTarget), kind(Goto) {} … … 236 262 const char * kindName() { return kindNames[kind]; } 237 263 238 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 239 private: 240 BranchStmt * clone() const override { return new BranchStmt{ *this }; } 241 MUTATE_FRIEND 264 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 265 private: 266 BranchStmt* clone() const override { return new BranchStmt{ *this }; } 267 268 /// Must be copied in ALL derived classes 269 template<typename node_t> 270 friend node_t * mutate(const node_t * node); 242 271 243 272 static const char * kindNames[kindEnd]; … … 248 277 ptr<Expr> expr; 249 278 250 ReturnStmt( const CodeLocation & loc, const Expr * expr, std::vector<Label>&& labels = {} )279 ReturnStmt( const CodeLocation& loc, const Expr* expr, std::vector<Label>&& labels = {} ) 251 280 : Stmt(loc, std::move(labels)), expr(expr) {} 252 281 253 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 254 private: 255 ReturnStmt * clone() const override { return new ReturnStmt{ *this }; } 256 MUTATE_FRIEND 282 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 283 private: 284 ReturnStmt* clone() const override { return new ReturnStmt{ *this }; } 285 286 /// Must be copied in ALL derived classes 287 template<typename node_t> 288 friend node_t * mutate(const node_t * node); 257 289 }; 258 290 … … 265 297 Kind kind; 266 298 267 ThrowStmt( const CodeLocation & loc, Kind kind, const Expr * expr, const Expr* target,268 std::vector<Label> 299 ThrowStmt( const CodeLocation& loc, Kind kind, const Expr* expr, const Expr* target, 300 std::vector<Label>&& labels = {} ) 269 301 : Stmt(loc, std::move(labels)), expr(expr), target(target), kind(kind) {} 270 302 271 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 272 private: 273 ThrowStmt * clone() const override { return new ThrowStmt{ *this }; } 274 MUTATE_FRIEND 303 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 304 private: 305 ThrowStmt* clone() const override { return new ThrowStmt{ *this }; } 306 307 /// Must be copied in ALL derived classes 308 template<typename node_t> 309 friend node_t * mutate(const node_t * node); 275 310 }; 276 311 … … 281 316 ptr<FinallyStmt> finally; 282 317 283 TryStmt( const CodeLocation & loc, const CompoundStmt* body,284 std::vector<ptr<CatchStmt>> && handlers, const FinallyStmt* finally,285 std::vector<Label> 318 TryStmt( const CodeLocation& loc, const CompoundStmt* body, 319 std::vector<ptr<CatchStmt>>&& handlers, const FinallyStmt* finally, 320 std::vector<Label>&& labels = {} ) 286 321 : Stmt(loc, std::move(labels)), body(body), handlers(std::move(handlers)), finally(finally) {} 287 322 288 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 289 private: 290 TryStmt * clone() const override { return new TryStmt{ *this }; } 291 MUTATE_FRIEND 323 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 324 private: 325 TryStmt* clone() const override { return new TryStmt{ *this }; } 326 327 /// Must be copied in ALL derived classes 328 template<typename node_t> 329 friend node_t * mutate(const node_t * node); 292 330 }; 293 331 … … 301 339 Kind kind; 302 340 303 CatchStmt( const CodeLocation & loc, Kind kind, const Decl * decl, const Expr* cond,304 const Stmt * body, std::vector<Label>&& labels = {} )341 CatchStmt( const CodeLocation& loc, Kind kind, const Decl* decl, const Expr* cond, 342 const Stmt* body, std::vector<Label>&& labels = {} ) 305 343 : Stmt(loc, std::move(labels)), decl(decl), cond(cond), body(body), kind(kind) {} 306 344 307 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 308 private: 309 CatchStmt * clone() const override { return new CatchStmt{ *this }; } 310 MUTATE_FRIEND 345 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 346 private: 347 CatchStmt* clone() const override { return new CatchStmt{ *this }; } 348 349 /// Must be copied in ALL derived classes 350 template<typename node_t> 351 friend node_t * mutate(const node_t * node); 311 352 }; 312 353 … … 315 356 ptr<CompoundStmt> body; 316 357 317 FinallyStmt( const CodeLocation & loc, const CompoundStmt* body,318 std::vector<Label> 358 FinallyStmt( const CodeLocation& loc, const CompoundStmt* body, 359 std::vector<Label>&& labels = {} ) 319 360 : Stmt(loc, std::move(labels)), body(body) {} 320 361 321 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 322 private: 323 FinallyStmt * clone() const override { return new FinallyStmt{ *this }; } 324 MUTATE_FRIEND 362 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 363 private: 364 FinallyStmt* clone() const override { return new FinallyStmt{ *this }; } 365 366 /// Must be copied in ALL derived classes 367 template<typename node_t> 368 friend node_t * mutate(const node_t * node); 325 369 }; 326 370 … … 353 397 OrElse orElse; 354 398 355 WaitForStmt( const CodeLocation & loc, std::vector<Label>&& labels = {} )399 WaitForStmt( const CodeLocation& loc, std::vector<Label>&& labels = {} ) 356 400 : Stmt(loc, std::move(labels)) {} 357 401 358 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 359 private: 360 WaitForStmt * clone() const override { return new WaitForStmt{ *this }; } 361 MUTATE_FRIEND 402 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 403 private: 404 WaitForStmt* clone() const override { return new WaitForStmt{ *this }; } 405 406 /// Must be copied in ALL derived classes 407 template<typename node_t> 408 friend node_t * mutate(const node_t * node); 362 409 }; 363 410 … … 367 414 ptr<Stmt> stmt; 368 415 369 WithStmt( const CodeLocation & loc, std::vector<ptr<Expr>> && exprs, const Stmt* stmt,370 std::vector<Label> 416 WithStmt( const CodeLocation& loc, std::vector<ptr<Expr>>&& exprs, const Stmt* stmt, 417 std::vector<Label>&& labels = {} ) 371 418 : Stmt(loc, std::move(labels)), exprs(std::move(exprs)), stmt(stmt) {} 372 419 373 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 374 private: 375 WithStmt * clone() const override { return new WithStmt{ *this }; } 376 MUTATE_FRIEND 420 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 421 private: 422 WithStmt* clone() const override { return new WithStmt{ *this }; } 423 424 /// Must be copied in ALL derived classes 425 template<typename node_t> 426 friend node_t * mutate(const node_t * node); 377 427 }; 378 428 … … 381 431 ptr<Decl> decl; 382 432 383 DeclStmt( const CodeLocation & loc, const Decl * decl, std::vector<Label>&& labels = {} )433 DeclStmt( const CodeLocation& loc, const Decl* decl, std::vector<Label>&& labels = {} ) 384 434 : Stmt(loc, std::move(labels)), decl(decl) {} 385 435 386 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 387 private: 388 DeclStmt * clone() const override { return new DeclStmt{ *this }; } 389 MUTATE_FRIEND 436 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 437 private: 438 DeclStmt* clone() const override { return new DeclStmt{ *this }; } 439 440 /// Must be copied in ALL derived classes 441 template<typename node_t> 442 friend node_t * mutate(const node_t * node); 390 443 }; 391 444 … … 394 447 readonly<Stmt> callStmt; 395 448 396 ImplicitCtorDtorStmt( const CodeLocation & loc, const Stmt* callStmt,397 std::vector<Label> 449 ImplicitCtorDtorStmt( const CodeLocation& loc, const Stmt* callStmt, 450 std::vector<Label>&& labels = {} ) 398 451 : Stmt(loc, std::move(labels)), callStmt(callStmt) {} 399 452 400 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 401 private: 402 ImplicitCtorDtorStmt * clone() const override { return new ImplicitCtorDtorStmt{ *this }; } 403 MUTATE_FRIEND 404 }; 405 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 const Stmt* accept( Visitor& v ) const override { return v.visit( this ); } 454 private: 455 ImplicitCtorDtorStmt* clone() const override { return new ImplicitCtorDtorStmt{ *this }; } 456 457 /// Must be copied in ALL derived classes 458 template<typename node_t> 459 friend node_t * mutate(const node_t * node); 460 }; 453 461 454 462 } 455 456 #undef MUTATE_FRIEND457 463 458 464 // Local Variables: //
Note: See TracChangeset
for help on using the changeset viewer.