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