source: icGREP/icgrep-devel/icgrep/pablo/pe_constant.h @ 5782

Last change on this file since 5782 was 5454, checked in by nmedfort, 2 years ago

Bug fix check in for DumpTrace?, compilation of DoBlock? / DoFinalBlock? functions. Pablo CodeMotionPass? optimized and enabled by default.

File size: 815 bytes
Line 
1#ifndef PE_CONSTANT_H
2#define PE_CONSTANT_H
3
4#include <pablo/pabloAST.h>
5
6namespace pablo {
7
8class Constant final : public PabloAST {
9    friend class PabloBlock;
10public:
11    static inline bool classof(const PabloAST * e) {
12        return e->getClassTypeId() == ClassTypeId::Ones;
13    }
14    static inline bool classof(const void *) {
15        return false;
16    }
17    virtual ~Constant() {
18    }
19    inline bool operator==(const Ones &) const {
20        return true;
21    }
22    virtual bool operator==(const PabloAST & other) const {
23        return isa<Ones>(other);
24    }
25protected:
26    Constant(Type * type, const PabloAST * const value, Allocator & allocator)
27    : PabloAST(ClassTypeId::Ones, type, allocators)
28    , mValue(value) {
29    }
30private:
31
32    const PabloAST * const mValue;
33};
34
35}
36
37#endif // PE_CONSTANT_H
Note: See TracBrowser for help on using the repository browser.