Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Stmt.hpp

    r6180274 r3b0bc16  
    1010// Created On       : Wed May  8 13:00:00 2019
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb  2 20:06:41 2022
    13 // Update Count     : 34
     12// Last Modified On : Tue Feb  1 17:44:46 2022
     13// Update Count     : 24
    1414//
    1515
     
    3939        std::vector<Label> labels;
    4040
    41         Stmt( const CodeLocation & loc, const std::vector<Label> && labels = {} )
     41        Stmt( const CodeLocation & loc, std::vector<Label> && labels = {} )
    4242                : ParseNode(loc), labels(std::move(labels)) {}
    4343
     
    5555        std::list<ptr<Stmt>> kids;
    5656
    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 = {} )
    5859                : Stmt(loc, std::move(labels)), kids(std::move(ks)) {}
    5960
     
    7374class NullStmt final : public Stmt {
    7475  public:
    75         NullStmt( const CodeLocation & loc, const std::vector<Label> && labels = {} )
     76        NullStmt( const CodeLocation & loc, std::vector<Label> && labels = {} )
    7677                : Stmt(loc, std::move(labels)) {}
    7778
     
    8788        ptr<Expr> expr;
    8889
    89         ExprStmt( const CodeLocation & loc, const Expr* e, const std::vector<Label> && labels = {} )
     90        ExprStmt( const CodeLocation & loc, const Expr* e, std::vector<Label> && labels = {} )
    9091                : Stmt(loc, std::move(labels)), expr(e) {}
    9192
     
    106107
    107108        AsmStmt( const CodeLocation & loc, bool isVolatile, const Expr * instruction,
    108                          const std::vector<ptr<Expr>> && output, const std::vector<ptr<Expr>> && input,
    109                          const std::vector<ptr<ConstantExpr>> && clobber, const std::vector<Label> && gotoLabels,
    110                          const std::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 = {})
    111112                : Stmt(loc, std::move(labels)), isVolatile(isVolatile), instruction(instruction),
    112113                  output(std::move(output)), input(std::move(input)), clobber(std::move(clobber)),
     
    143144
    144145        IfStmt( const CodeLocation & loc, const Expr * cond, const Stmt * then,
    145                         const Stmt * else_ = nullptr, const std::vector<ptr<Stmt>> && inits = {},
    146                         const std::vector<Label> && labels = {} )
     146                        const Stmt * else_ = nullptr, std::vector<ptr<Stmt>> && inits = {},
     147                        std::vector<Label> && labels = {} )
    147148                : Stmt(loc, std::move(labels)), cond(cond), then(then), else_(else_),
    148149                  inits(std::move(inits)) {}
     
    160161        std::vector<ptr<Stmt>> stmts;
    161162
    162         SwitchStmt( const CodeLocation & loc, const Expr * cond, const std::vector<ptr<Stmt>> && stmts,
    163                                 const std::vector<Label> && labels = {} )
     163        SwitchStmt( const CodeLocation & loc, const Expr * cond, std::vector<ptr<Stmt>> && stmts,
     164                                std::vector<Label> && labels = {} )
    164165                : Stmt(loc, std::move(labels)), cond(cond), stmts(std::move(stmts)) {}
    165166
     
    177178        std::vector<ptr<Stmt>> stmts;
    178179
    179         CaseStmt( const CodeLocation & loc, const Expr * cond, const std::vector<ptr<Stmt>> && stmts,
    180                           const std::vector<Label> && labels = {} )
     180        CaseStmt( const CodeLocation & loc, const Expr * cond, std::vector<ptr<Stmt>> && stmts,
     181                          std::vector<Label> && labels = {} )
    181182                : Stmt(loc, std::move(labels)), cond(cond), stmts(std::move(stmts)) {}
    182183
     
    199200
    200201        WhileDoStmt( const CodeLocation & loc, const Expr * cond, const Stmt * body,
    201                                  const std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, const std::vector<Label> && labels = {} )
     202                           std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, std::vector<Label> && labels = {} )
    202203                : Stmt(loc, std::move(labels)), cond(cond), body(body), else_(nullptr), inits(std::move(inits)), isDoWhile(isDoWhile) {}
    203204
    204205        WhileDoStmt( const CodeLocation & loc, const Expr * cond, const Stmt * body, const Stmt * else_,
    205                                  const std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, const std::vector<Label> && labels = {} )
     206                           std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, std::vector<Label> && labels = {} )
    206207                : Stmt(loc, std::move(labels)), cond(cond), body(body), else_(else_), inits(std::move(inits)), isDoWhile(isDoWhile) {}
    207208
     
    221222        ptr<Stmt> else_;
    222223
    223         ForStmt( const CodeLocation & loc, const std::vector<ptr<Stmt>> && inits, const Expr * cond,
    224                          const Expr * inc, const Stmt * body, const std::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 = {} )
    225226                : Stmt(loc, std::move(label)), inits(std::move(inits)), cond(cond), inc(inc), body(body), else_(nullptr) {}
    226227
    227         ForStmt( const CodeLocation & loc, const std::vector<ptr<Stmt>> && inits, const Expr * cond,
    228                          const Expr * inc, const Stmt * body, const Stmt * else_, const std::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 = {} )
    229230                : Stmt(loc, std::move(labels)), inits(std::move(inits)), cond(cond), inc(inc), body(body), else_(else_) {}
    230231
     
    246247        Kind kind;
    247248
    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) {}
    251255
    252256        const char * kindName() const { return kindNames[kind]; }
     
    265269        ptr<Expr> expr;
    266270
    267         ReturnStmt( const CodeLocation & loc, const Expr * expr, const std::vector<Label> && labels = {} )
     271        ReturnStmt( const CodeLocation & loc, const Expr * expr, std::vector<Label> && labels = {} )
    268272                : Stmt(loc, std::move(labels)), expr(expr) {}
    269273
     
    284288        ExceptionKind kind;
    285289
    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 = {} )
    288293                : Stmt(loc, std::move(labels)), expr(expr), target(target), kind(kind) {}
    289294
     
    301306        ptr<FinallyStmt> finally;
    302307
    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 = {} )
    306312                : Stmt(loc, std::move(labels)), body(body), handlers(std::move(handlers)), finally(finally) {}
    307313
     
    320326        ExceptionKind kind;
    321327
    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 = {} )
    324331                : Stmt(loc, std::move(labels)), decl(decl), cond(cond), body(body), kind(kind) {}
    325332
     
    351358        enum Type { None, Coroutine, Generator } type = None;
    352359
    353         SuspendStmt( const CodeLocation & loc, const CompoundStmt * then, Type type, const std::vector<Label> && labels = {} )
     360        SuspendStmt( const CodeLocation & loc, const CompoundStmt * then, Type type, std::vector<Label> && labels = {} )
    354361                : Stmt(loc, std::move(labels)), then(then), type(type) {}
    355362
     
    389396        OrElse orElse;
    390397
    391         WaitForStmt( const CodeLocation & loc, const std::vector<Label> && labels = {} )
     398        WaitForStmt( const CodeLocation & loc, std::vector<Label> && labels = {} )
    392399                : Stmt(loc, std::move(labels)) {}
    393400
     
    403410        ptr<Decl> decl;
    404411
    405         DeclStmt( const CodeLocation & loc, const Decl * decl, const std::vector<Label> && labels = {} )
     412        DeclStmt( const CodeLocation & loc, const Decl * decl, std::vector<Label> && labels = {} )
    406413                : Stmt(loc, std::move(labels)), decl(decl) {}
    407414
     
    434441
    435442        MutexStmt( const CodeLocation & loc, const Stmt * stmt,
    436                            const std::vector<ptr<Expr>> && mutexes, const std::vector<Label> && labels = {} )
     443                           std::vector<ptr<Expr>> && mutexes, std::vector<Label> && labels = {} )
    437444                : Stmt(loc, std::move(labels)), stmt(stmt), mutexObjs(std::move(mutexes)) {}
    438445
Note: See TracChangeset for help on using the changeset viewer.