source: icGREP/icgrep-devel/icgrep/pablo/pe_advance.h @ 4280

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

More Pablo IR manipulation functionality; finished use analysis optimizer (requires boost). Removed remaining LLVM optimization passes.

File size: 1.3 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_ADVANCE_H
8#define PE_ADVANCE_H
9
10#include "pabloAST.h"
11
12namespace pablo {
13
14class Advance : public PabloAST {
15    friend class PabloBlock;
16public:
17    static inline bool classof(const PabloAST * e) {
18        return e->getClassTypeId() == ClassTypeId::Advance;
19    }
20    static inline bool classof(const void *) {
21        return false;
22    }
23    virtual ~Advance() {
24    }
25    virtual PabloAST * getOperand(const unsigned index) const {
26        assert (index == 0);
27        return mExpr;
28    }
29    virtual void setOperand(const unsigned index, PabloAST * value) {
30        assert (index == 0);
31        mExpr = value;
32    }
33    virtual unsigned getNumOperands() const {
34        return 1;
35    }
36    inline PabloAST * getExpr() const {
37        return mExpr;
38    }
39    inline int getAdvanceAmount() const {
40        return mShiftAmount;
41    }
42protected:
43    void* operator new (std::size_t size) noexcept {
44        return mAllocator.allocate(size);
45    }
46    Advance(PabloAST * expr, int shiftAmount)
47    : PabloAST(ClassTypeId::Advance)
48    , mExpr(expr)
49        , mShiftAmount(shiftAmount) {
50
51    }
52private:
53    PabloAST * mExpr;
54        int const mShiftAmount;
55};
56
57}
58
59#endif // PE_ADVANCE_H
60
61
62
Note: See TracBrowser for help on using the repository browser.