source: icGREP/icgrep-devel/icgrep/pablo/pe_call.h @ 4410

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

Changes to support 3-operand form for all instructions. CSE disabled but partially redundant now.

File size: 1.1 KB
Line 
1#ifndef PE_CALL_H
2#define PE_CALL_H
3
4#include <pablo/pabloAST.h>
5#include <pablo/pe_string.h>
6#include <iostream>
7
8namespace pablo {
9
10class Call : public Statement {
11    friend class PabloBlock;
12public:
13    static inline bool classof(const PabloAST * e) {
14        return e->getClassTypeId() == ClassTypeId::Call;
15    }
16    static inline bool classof(const void *) {
17        return false;
18    }
19    virtual ~Call() {
20    }
21    virtual PabloAST * getOperand(const unsigned index) const {
22        assert (index == 0);
23        return mCallee;
24    }
25    virtual unsigned getNumOperands() const {
26        return 1;
27    }
28    virtual void setOperand(const unsigned index, PabloAST * value) {
29        assert (index == 0);
30        assert (isa<String>(value));
31        mCallee = cast<String>(value);
32    }
33    inline const String * getCallee() const {
34        return mCallee;
35    }
36protected:
37    Call(PabloAST * callee, PabloBlock * parent)
38    : Statement(ClassTypeId::Call, cast<String>(callee), parent)
39    , mCallee(cast<String>(callee)) {
40
41    }
42private:
43    String * mCallee;
44};
45}
46
47#endif // PE_CALL_H
48
49
Note: See TracBrowser for help on using the repository browser.