source: icGREP/icgrep-devel/icgrep/pablo/pe_not.h @ 4214

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

Partial implementation of 'PabloBuilder?'.

File size: 1.1 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 PE_NOT_H
8#define PE_NOT_H
9
10#include <pablo/pe_pabloe.h>
11
12namespace pablo {
13
14struct CodeGenState;
15
16class Not : public PabloE {
17    friend struct OptimizeNot;
18    friend struct CodeGenState;
19public:
20    static inline bool classof(const PabloE * e) {
21        return e->getClassTypeId() == ClassTypeId::Not;
22    }
23    static inline bool classof(const void *) {
24        return false;
25    }
26    virtual ~Not() {
27    }
28    PabloE * getExpr() const {
29        return mExpr;
30    }
31protected:
32    Not(PabloE * expr)
33    : PabloE(ClassTypeId::Not)
34    , mExpr(expr) {
35
36    }
37private:
38    PabloE * const mExpr;
39};
40struct OptimizeNot {
41    inline OptimizeNot(CodeGenState & cg) : cg(cg) {}
42    PabloE * operator()(PabloE * expr);
43private:
44    CodeGenState & cg;
45
46};
47inline PabloE * makeNot(PabloE * expr, CodeGenState & cg) {
48    OptimizeNot run(cg);
49    return run(expr);
50}
51}
52
53#endif // PE_NOT_H
54
55
Note: See TracBrowser for help on using the repository browser.