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

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

Possible fix for segfault issue. CC seems to be generating the same charclass multiple times.

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