Ignore:
Timestamp:
Jun 18, 2016, 9:50:11 PM (3 years ago)
Author:
cameron
Message:

pablo.Count is a pure statement, setting an accumulator state variable

Location:
icGREP/icgrep-devel/icgrep/pablo
Files:
5 edited

Legend:

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

    r5042 r5061  
    213213}
    214214
    215 PabloAST * PabloBuilder::createCount(PabloAST * expr) {
    216     MAKE_UNARY(createCount, PabloAST::ClassTypeId::Count, expr);
    217     return result;
    218 }
    219 
    220 PabloAST * PabloBuilder::createCount(PabloAST * expr, const std::string prefix) {
    221     MAKE_UNARY(createCount, PabloAST::ClassTypeId::Count, expr, prefix);
    222     return result;
    223 }
    224 
    225 }
     215}
  • icGREP/icgrep-devel/icgrep/pablo/builder.hpp

    r5042 r5061  
    137137    PabloAST * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr, const std::string prefix);
    138138   
    139     PabloAST * createCount(PabloAST * expr);
    140    
    141     PabloAST * createCount(PabloAST * expr, const std::string prefix);
     139    Count * createCount(const std::string counter, PabloAST * expr) {
     140        return mPb->createCount(counter, expr);
     141    }
    142142   
    143143    PabloAST * createInFile(PabloAST * expr);
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.cpp

    r5042 r5061  
    142142    assert (name);
    143143    return new Var(name);
    144 }
    145 
    146 PabloAST * PabloBlock::createCount(PabloAST * expr) {
    147     assert (expr);
    148     return insertAtInsertionPoint(new Count(expr, makeName("count_")));
    149 }
    150 
    151 PabloAST * PabloBlock::createCount(PabloAST * expr, const std::string prefix) {
    152     assert (expr);
    153     return insertAtInsertionPoint(new Count(expr, makeName(prefix, false)));
    154144}
    155145
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.h

    r5042 r5061  
    179179    PabloAST * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr, const std::string prefix);
    180180
    181     PabloAST * createCount(PabloAST * expr);
    182    
    183     PabloAST * createCount(PabloAST * expr, const std::string prefix);
     181    Count * createCount(const std::string counter, PabloAST * const expr);
    184182   
    185183    PabloAST * createInFile(PabloAST * expr);
  • icGREP/icgrep-devel/icgrep/pablo/pe_count.h

    r4720 r5061  
    2626        return getOperand(0);
    2727    }
    28     inline void setGlobalCountIndex(const unsigned idx) {
    29         globalCountIndex = idx;
    30     }
    31     inline unsigned getGlobalCountIndex() const {
    32         return globalCountIndex;
    33     }
    3428protected:
    35     Count(PabloAST * expr, String * name)
    36     : Statement(ClassTypeId::Count, {expr}, name)
     29    explicit Count(PabloAST * expr, String * counter)
     30    : Statement(ClassTypeId::Count, {expr}, counter)
    3731    {
    3832
    3933    }
    4034private:
    41     unsigned globalCountIndex;
    4235};
    4336
Note: See TracChangeset for help on using the changeset viewer.