Changes in src/AST/Stmt.hpp [6180274:3b0bc16]
- File:
-
- 1 edited
-
src/AST/Stmt.hpp (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Stmt.hpp
r6180274 r3b0bc16 10 10 // Created On : Wed May 8 13:00:00 2019 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 2 20:06:41202213 // Update Count : 3412 // Last Modified On : Tue Feb 1 17:44:46 2022 13 // Update Count : 24 14 14 // 15 15 … … 39 39 std::vector<Label> labels; 40 40 41 Stmt( const CodeLocation & loc, conststd::vector<Label> && labels = {} )41 Stmt( const CodeLocation & loc, std::vector<Label> && labels = {} ) 42 42 : ParseNode(loc), labels(std::move(labels)) {} 43 43 … … 55 55 std::list<ptr<Stmt>> kids; 56 56 57 CompoundStmt(const CodeLocation & loc, const std::list<ptr<Stmt>> && ks = {}, const std::vector<Label> && labels = {} ) 57 CompoundStmt(const CodeLocation & loc, std::list<ptr<Stmt>> && ks = {}, 58 std::vector<Label> && labels = {} ) 58 59 : Stmt(loc, std::move(labels)), kids(std::move(ks)) {} 59 60 … … 73 74 class NullStmt final : public Stmt { 74 75 public: 75 NullStmt( const CodeLocation & loc, conststd::vector<Label> && labels = {} )76 NullStmt( const CodeLocation & loc, std::vector<Label> && labels = {} ) 76 77 : Stmt(loc, std::move(labels)) {} 77 78 … … 87 88 ptr<Expr> expr; 88 89 89 ExprStmt( const CodeLocation & loc, const Expr* e, conststd::vector<Label> && labels = {} )90 ExprStmt( const CodeLocation & loc, const Expr* e, std::vector<Label> && labels = {} ) 90 91 : Stmt(loc, std::move(labels)), expr(e) {} 91 92 … … 106 107 107 108 AsmStmt( const CodeLocation & loc, bool isVolatile, const Expr * instruction, 108 const std::vector<ptr<Expr>> && output, conststd::vector<ptr<Expr>> && input,109 const std::vector<ptr<ConstantExpr>> && clobber, conststd::vector<Label> && gotoLabels,110 conststd::vector<Label> && labels = {})109 std::vector<ptr<Expr>> && output, std::vector<ptr<Expr>> && input, 110 std::vector<ptr<ConstantExpr>> && clobber, std::vector<Label> && gotoLabels, 111 std::vector<Label> && labels = {}) 111 112 : Stmt(loc, std::move(labels)), isVolatile(isVolatile), instruction(instruction), 112 113 output(std::move(output)), input(std::move(input)), clobber(std::move(clobber)), … … 143 144 144 145 IfStmt( const CodeLocation & loc, const Expr * cond, const Stmt * then, 145 const Stmt * else_ = nullptr, conststd::vector<ptr<Stmt>> && inits = {},146 conststd::vector<Label> && labels = {} )146 const Stmt * else_ = nullptr, std::vector<ptr<Stmt>> && inits = {}, 147 std::vector<Label> && labels = {} ) 147 148 : Stmt(loc, std::move(labels)), cond(cond), then(then), else_(else_), 148 149 inits(std::move(inits)) {} … … 160 161 std::vector<ptr<Stmt>> stmts; 161 162 162 SwitchStmt( const CodeLocation & loc, const Expr * cond, conststd::vector<ptr<Stmt>> && stmts,163 conststd::vector<Label> && labels = {} )163 SwitchStmt( const CodeLocation & loc, const Expr * cond, std::vector<ptr<Stmt>> && stmts, 164 std::vector<Label> && labels = {} ) 164 165 : Stmt(loc, std::move(labels)), cond(cond), stmts(std::move(stmts)) {} 165 166 … … 177 178 std::vector<ptr<Stmt>> stmts; 178 179 179 CaseStmt( const CodeLocation & loc, const Expr * cond, conststd::vector<ptr<Stmt>> && stmts,180 conststd::vector<Label> && labels = {} )180 CaseStmt( const CodeLocation & loc, const Expr * cond, std::vector<ptr<Stmt>> && stmts, 181 std::vector<Label> && labels = {} ) 181 182 : Stmt(loc, std::move(labels)), cond(cond), stmts(std::move(stmts)) {} 182 183 … … 199 200 200 201 WhileDoStmt( const CodeLocation & loc, const Expr * cond, const Stmt * body, 201 const std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, conststd::vector<Label> && labels = {} )202 std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, std::vector<Label> && labels = {} ) 202 203 : Stmt(loc, std::move(labels)), cond(cond), body(body), else_(nullptr), inits(std::move(inits)), isDoWhile(isDoWhile) {} 203 204 204 205 WhileDoStmt( const CodeLocation & loc, const Expr * cond, const Stmt * body, const Stmt * else_, 205 const std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, conststd::vector<Label> && labels = {} )206 std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, std::vector<Label> && labels = {} ) 206 207 : Stmt(loc, std::move(labels)), cond(cond), body(body), else_(else_), inits(std::move(inits)), isDoWhile(isDoWhile) {} 207 208 … … 221 222 ptr<Stmt> else_; 222 223 223 ForStmt( const CodeLocation & loc, conststd::vector<ptr<Stmt>> && inits, const Expr * cond,224 const Expr * inc, const Stmt * body, conststd::vector<Label> && label = {} )224 ForStmt( const CodeLocation & loc, std::vector<ptr<Stmt>> && inits, const Expr * cond, 225 const Expr * inc, const Stmt * body, std::vector<Label> && label = {} ) 225 226 : Stmt(loc, std::move(label)), inits(std::move(inits)), cond(cond), inc(inc), body(body), else_(nullptr) {} 226 227 227 ForStmt( const CodeLocation & loc, conststd::vector<ptr<Stmt>> && inits, const Expr * cond,228 const Expr * inc, const Stmt * body, const Stmt * else_, conststd::vector<Label> && labels = {} )228 ForStmt( const CodeLocation & loc, std::vector<ptr<Stmt>> && inits, const Expr * cond, 229 const Expr * inc, const Stmt * body, const Stmt * else_, std::vector<Label> && labels = {} ) 229 230 : Stmt(loc, std::move(labels)), inits(std::move(inits)), cond(cond), inc(inc), body(body), else_(else_) {} 230 231 … … 246 247 Kind kind; 247 248 248 BranchStmt( const CodeLocation & loc, Kind kind, Label target, const std::vector<Label> && labels = {} ); 249 BranchStmt( const CodeLocation & loc, const Expr * computedTarget, const std::vector<Label> && labels = {} ) 250 : Stmt(loc, std::move(labels)), originalTarget(loc), target(loc), computedTarget(computedTarget), kind(Goto) {} 249 BranchStmt( const CodeLocation & loc, Kind kind, Label target, 250 std::vector<Label> && labels = {} ); 251 BranchStmt( const CodeLocation & loc, const Expr * computedTarget, 252 std::vector<Label> && labels = {} ) 253 : Stmt(loc, std::move(labels)), originalTarget(loc), target(loc), 254 computedTarget(computedTarget), kind(Goto) {} 251 255 252 256 const char * kindName() const { return kindNames[kind]; } … … 265 269 ptr<Expr> expr; 266 270 267 ReturnStmt( const CodeLocation & loc, const Expr * expr, conststd::vector<Label> && labels = {} )271 ReturnStmt( const CodeLocation & loc, const Expr * expr, std::vector<Label> && labels = {} ) 268 272 : Stmt(loc, std::move(labels)), expr(expr) {} 269 273 … … 284 288 ExceptionKind kind; 285 289 286 ThrowStmt( const CodeLocation & loc, ExceptionKind kind, const Expr * expr, 287 const Expr * target, const std::vector<Label> && labels = {} ) 290 ThrowStmt( 291 const CodeLocation & loc, ExceptionKind kind, const Expr * expr, const Expr * target, 292 std::vector<Label> && labels = {} ) 288 293 : Stmt(loc, std::move(labels)), expr(expr), target(target), kind(kind) {} 289 294 … … 301 306 ptr<FinallyStmt> finally; 302 307 303 TryStmt( const CodeLocation & loc, const CompoundStmt * body, 304 const std::vector<ptr<CatchStmt>> && handlers, const FinallyStmt * finally, 305 const std::vector<Label> && labels = {} ) 308 TryStmt( 309 const CodeLocation & loc, const CompoundStmt * body, 310 std::vector<ptr<CatchStmt>> && handlers, const FinallyStmt * finally, 311 std::vector<Label> && labels = {} ) 306 312 : Stmt(loc, std::move(labels)), body(body), handlers(std::move(handlers)), finally(finally) {} 307 313 … … 320 326 ExceptionKind kind; 321 327 322 CatchStmt( const CodeLocation & loc, ExceptionKind kind, const Decl * decl, const Expr * cond, 323 const Stmt * body, const std::vector<Label> && labels = {} ) 328 CatchStmt( 329 const CodeLocation & loc, ExceptionKind kind, const Decl * decl, const Expr * cond, 330 const Stmt * body, std::vector<Label> && labels = {} ) 324 331 : Stmt(loc, std::move(labels)), decl(decl), cond(cond), body(body), kind(kind) {} 325 332 … … 351 358 enum Type { None, Coroutine, Generator } type = None; 352 359 353 SuspendStmt( const CodeLocation & loc, const CompoundStmt * then, Type type, conststd::vector<Label> && labels = {} )360 SuspendStmt( const CodeLocation & loc, const CompoundStmt * then, Type type, std::vector<Label> && labels = {} ) 354 361 : Stmt(loc, std::move(labels)), then(then), type(type) {} 355 362 … … 389 396 OrElse orElse; 390 397 391 WaitForStmt( const CodeLocation & loc, conststd::vector<Label> && labels = {} )398 WaitForStmt( const CodeLocation & loc, std::vector<Label> && labels = {} ) 392 399 : Stmt(loc, std::move(labels)) {} 393 400 … … 403 410 ptr<Decl> decl; 404 411 405 DeclStmt( const CodeLocation & loc, const Decl * decl, conststd::vector<Label> && labels = {} )412 DeclStmt( const CodeLocation & loc, const Decl * decl, std::vector<Label> && labels = {} ) 406 413 : Stmt(loc, std::move(labels)), decl(decl) {} 407 414 … … 434 441 435 442 MutexStmt( const CodeLocation & loc, const Stmt * stmt, 436 const std::vector<ptr<Expr>> && mutexes, conststd::vector<Label> && labels = {} )443 std::vector<ptr<Expr>> && mutexes, std::vector<Label> && labels = {} ) 437 444 : Stmt(loc, std::move(labels)), stmt(stmt), mutexObjs(std::move(mutexes)) {} 438 445
Note:
See TracChangeset
for help on using the changeset viewer.