Ignore:
Timestamp:
Oct 31, 2014, 6:04:25 PM (5 years ago)
Author:
nmedfort
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pe_next.h

    r4276 r4280  
    44#include <pablo/pabloAST.h>
    55#include <pablo/ps_assign.h>
     6#include <array>
    67
    78namespace pablo {
     
    1819        return false;
    1920    }
     21    virtual PabloAST * getOperand(const unsigned index) const {
     22        assert (index < 2);
     23        return mExprs[index];
     24    }
     25    virtual unsigned getNumOperands() const {
     26        return 2;
     27    }
     28    virtual void setOperand(const unsigned index, PabloAST * value) {
     29        assert (index < 2);
     30        assert (index == 0 || isa<Assign>(value));
     31        mExprs[index] = value;
     32    }
    2033    inline const Assign * getInitial() const {
    21         return mInitial;
     34        return cast<const Assign>(mExprs[0]);
    2235    }
    2336    inline const String * getName() const {
    24         return mInitial->getName();
     37        return getInitial()->getName();
    2538    }
    2639    inline PabloAST * getExpr() const {
    27         return mExpr;
     40        return mExprs[1];
    2841    }
    2942protected:
     
    3144        return mAllocator.allocate(size);
    3245    }
    33     Next(const PabloAST * initial, PabloAST * expr)
    34     : Statement(ClassTypeId::Next)
    35     , mInitial(cast<Assign>(initial))
    36     , mExpr(expr)
     46    Next(PabloAST * initial, PabloAST * expr, StatementList * parent)
     47    : Statement(ClassTypeId::Next, parent)
     48    , mExprs({cast<Assign>(initial), expr})
    3749    {
    3850
    3951    }
    4052private:
    41     const Assign * const      mInitial;
    42     PabloAST * const          mExpr;
     53    std::array<PabloAST*, 2>  mExprs;
    4354};
    4455
Note: See TracChangeset for help on using the changeset viewer.