source: icGREP/icgrep-devel/icgrep/pablo/ps_while.h @ 4264

Last change on this file since 4264 was 4264, checked in by nmedfort, 4 years ago

Eliminated need for Mem2Reg pass. Automatic introduction of PHI nodes for Next nodes.

File size: 1.2 KB
Line 
1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef PS_WHILE_H
8#define PS_WHILE_H
9
10#include <pablo/pabloAST.h>
11
12namespace pablo {
13
14class While : public PabloAST {
15    friend class PabloBlock;
16public:
17    static inline bool classof(const PabloAST * e) {
18        return e->getClassTypeId() == ClassTypeId::While;
19    }
20    static inline bool classof(const void *) {
21        return false;
22    }
23    virtual ~While() {
24    }
25    inline PabloAST * getCondition() const {
26        return mExpr;
27    }
28    inline const StatementList & getBody() const {
29        return mBody;
30    }
31    inline void setInclusiveCarryCount(const unsigned count) {
32        mCarryCount = count;
33    }
34    inline unsigned getInclusiveCarryCount() const {
35        return mCarryCount;
36    }
37protected:
38    While(PabloAST * expr, StatementList && body)
39    : PabloAST(ClassTypeId::While)
40    , mExpr(expr)
41    , mBody(std::move(body))
42    , mCarryCount(0)
43    {
44
45    }
46private:
47    PabloAST * const    mExpr;
48    StatementList      mBody;
49    unsigned            mCarryCount;
50};
51
52}
53
54#endif // PS_WHILE_H
55
56
Note: See TracBrowser for help on using the repository browser.