Ignore:
Timestamp:
Jun 12, 2015, 3:11:10 PM (4 years ago)
Author:
nmedfort
Message:

Temporary check-in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/builder.cpp

    r4602 r4603  
    2828PabloAST * result = mExprTable.findBinaryOrCall(std::move(functor), TYPE, ARGS)
    2929
     30#define MAKE_NAMED_BINARY(NAME, TYPE, ARGS...) \
     31struct __##NAME { \
     32    inline PabloAST * operator()(PabloAST * arg1, PabloAST * arg2, const std::string name) { \
     33        return mPb.NAME(arg1, arg2, name); \
     34    } \
     35    inline __##NAME(PabloBlock & pb) : mPb(pb) {} \
     36private: \
     37    PabloBlock & mPb; \
     38}; \
     39__##NAME functor(mPb); \
     40PabloAST * result = mExprTable.findBinaryOrCall(std::move(functor), TYPE, ARGS)
     41
    3042#define MAKE_TERNARY(NAME, TYPE, ARGS...) \
    3143struct __##NAME { \
     
    4860PabloAST * PabloBuilder::createAdvance(PabloAST * expr, PabloAST * shiftAmount) {
    4961    MAKE_BINARY(createAdvance, PabloAST::ClassTypeId::Advance, expr, shiftAmount);
     62    return result;
     63}
     64
     65PabloAST * PabloBuilder::createAdvance(PabloAST * expr, PabloAST * shiftAmount, const std::string prefix) {
     66    MAKE_NAMED_BINARY(createAdvance, PabloAST::ClassTypeId::Advance, expr, shiftAmount, prefix);
    5067    return result;
    5168}
Note: See TracChangeset for help on using the changeset viewer.