source: icGREP/icgrep-devel/icgrep/pablo/function.h @ 4656

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

Temporary check-in.

File size: 995 bytes
RevLine 
[4656]1#ifndef FUNCTION_H
2#define FUNCTION_H
3
4#include <pablo/pabloAST.h>
5
6namespace pablo {
7
8class Var;
9class Assign;
10
11enum class ArgumentType {
12    In = 0
13    , Out = 1
14    , InOut = 2
15};
16
17using Argument = std::pair<ArgumentType, PabloAST *>;
18
19class Function : public PabloAST {
20    using ArgumentListAllocator = VectorAllocator::rebind<Argument>::other;
21    using ArgumentListType = std::vector<Argument, ArgumentListAllocator>;
22    friend class PabloBlock;
23public:
24    static inline bool classof(const PabloAST * e) {
25        return e->getClassTypeId() == ClassTypeId::Function;
26    }
27    static inline bool classof(const void *) {
28        return false;
29    }
30    virtual ~Function() { }
31    virtual bool operator==(const PabloAST & other) const {
32        return &other == this;
33    }
34protected:
35    Function();
36    Function(std::initializer_list<Argument *> args);
37    Function(const std::vector<Argument *> & args);
38private:
39    ArgumentListType        mArgumentList;
40};
41
42}
43
44#endif // FUNCTION_H
Note: See TracBrowser for help on using the repository browser.