Ignore:
Timestamp:
Dec 23, 2015, 11:47:47 AM (3 years ago)
Author:
cameron
Message:

Add IRBuilder functionality to IDISA_Builder; eliminate separate mBuilder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.h

    r4895 r4898  
    1717namespace IDISA {
    1818
    19 class IDISA_Builder {
     19    class IDISA_Builder : public IRBuilder<> {
    2020public:
    2121
    22     IDISA_Builder(Type * bitBlockType)
    23     : mMod(nullptr)
    24     , mLLVMBuilder(nullptr)
     22        IDISA_Builder(Module * m, Type * bitBlockType) : IRBuilder<>(m->getContext())
     23    , mMod(m)
    2524    , mBitBlockType(bitBlockType)
    2625    , mBitBlockWidth(bitBlockType->isIntegerTy() ? cast<IntegerType>(bitBlockType)->getIntegerBitWidth() : cast<VectorType>(bitBlockType)->getBitWidth())
     
    3130    }
    3231    virtual ~IDISA_Builder() {};
    33 
    34     void initialize(Module * m, IRBuilder <> * b) {
    35         mMod = m;
    36         mLLVMBuilder = b;
    37     }
    3832   
    3933    Type * getBitBlockType() { return mBitBlockType;}
    40     Value * bitCast(Value * a) {return a->getType() == mBitBlockType ? a : mLLVMBuilder->CreateBitCast(a, mBitBlockType);}
     34    Value * bitCast(Value * a) {return a->getType() == mBitBlockType ? a : CreateBitCast(a, mBitBlockType);}
    4135    int getBitBlockWidth() { return mBitBlockWidth;}
    4236    Module * getModule() {return mMod;}
     
    9286protected:
    9387    Module * mMod;
    94     IRBuilder <> * mLLVMBuilder;
    9588    Type * mBitBlockType;
    9689    unsigned mBitBlockWidth;
Note: See TracChangeset for help on using the changeset viewer.