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

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

Added pablo Prototype to compiler. All Calls must be given one instead of a Name.

File size: 922 bytes
Line 
1#ifndef PE_CALL_H
2#define PE_CALL_H
3
4#include <pablo/pabloAST.h>
5#include <pablo/function.h>
6
7namespace pablo {
8
9class Call : public Statement {
10    friend class PabloBlock;
11public:
12    static inline bool classof(const PabloAST * e) {
13        return e->getClassTypeId() == ClassTypeId::Call;
14    }
15    static inline bool classof(const void *) {
16        return false;
17    }
18    virtual ~Call() { }
19    inline const String * getCallee() const {
20        return cast<Prototype>(getOperand(0))->getName();
21    }
22    inline void setLocalCarryIndex(const unsigned idx) {
23        mLocalCarryIndex = idx;
24    }
25    inline unsigned getLocalCarryIndex() const {
26        return mLocalCarryIndex;
27    }
28protected:
29    Call(PabloAST * prototype)
30    : Statement(ClassTypeId::Call, {prototype}, cast<Prototype>(prototype)->getName())
31    , mLocalCarryIndex(0) {
32
33    }
34private:
35    unsigned mLocalCarryIndex;
36};
37}
38
39#endif // PE_CALL_H
40
41
Note: See TracBrowser for help on using the repository browser.