source: icGREP/icgrep-devel/icgrep/pablo/ps_assign.h @ 4414

Last change on this file since 4414 was 4414, checked in by nmedfort, 5 years ago

Minor changes towards maintaining UseDef? information.

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_SETMARKER_H
8#define PS_SETMARKER_H
9
10#include <pablo/pe_string.h>
11#include <pablo/symbol_generator.h>
12#include <array>
13
14namespace pablo {
15
16class Assign : public Statement {
17    friend class PabloBlock;
18    friend class Next;
19    friend class Var;
20public:
21    static inline bool classof(const PabloAST * e) {
22        return e->getClassTypeId() == ClassTypeId::Assign;
23    }
24    static inline bool classof(const void *) {
25        return false;
26    }
27    virtual ~Assign() {
28    }
29    inline PabloAST * getExpr() const {
30        return mOperand[0];
31    }
32    inline bool isOutputAssignment() const {
33        return mOutputIndex >= 0;
34    }
35    inline int getOutputIndex() const {
36        return mOutputIndex;
37    }
38protected:
39    explicit Assign(PabloAST * expr, int outputIndex, String * name, PabloBlock * parent)
40    : Statement(ClassTypeId::Assign, {expr}, name, parent)
41    , mOutputIndex(outputIndex)
42    {
43
44    }
45private:
46    const int           mOutputIndex;
47};
48
49}
50
51#endif // PS_SETMARKER_H
52
Note: See TracBrowser for help on using the repository browser.