Ignore:
Timestamp:
Aug 26, 2016, 12:48:42 PM (3 years ago)
Author:
cameron
Message:

refine PabloKernel? signature based on CountOnly? parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r5091 r5134  
    8686    mLineBreak = mPB.createOr(lb, unterminatedLineAtEOF);
    8787    mAny = mPB.createNot(lb, "any");
    88     mFunction.setResult(1, mPB.createAssign("lf", mLineBreak));
     88    if (!mCountOnly) mFunction.setResult(1, mPB.createAssign("lf", mLineBreak));
    8989    return;
    9090}
     
    170170    mLineBreak = mPB.createOr(lb, unterminatedLineAtEOF);
    171171    mAny = mPB.createNot(lb, "any");
    172     mFunction.setResult(1, mPB.createAssign("lf", mLineBreak));
     172    if (!mCountOnly) mFunction.setResult(1, mPB.createAssign("lf", mLineBreak));
    173173}
    174174
     
    212212    }
    213213    Assign * matches = mPB.createAssign("matches", mPB.createAnd(match_follow, mLineBreak));
    214     mFunction.setResultCount(mPB.createCount("matchedLineCount", matches));
    215     mFunction.setResult(0, matches);
     214    if (mCountOnly) {
     215        mFunction.setResultCount(mPB.createCount("matchedLineCount", matches));
     216    }
     217    else {
     218        mFunction.setResult(0, matches);
     219    }
    216220}
    217221
     
    626630}
    627631
    628 RE_Compiler::RE_Compiler(pablo::PabloFunction & function, cc::CC_Compiler & ccCompiler)
    629 : mCCCompiler(ccCompiler)
     632RE_Compiler::RE_Compiler(pablo::PabloFunction & function, cc::CC_Compiler & ccCompiler, bool CountOnly)
     633: mCountOnly(CountOnly)
     634, mCCCompiler(ccCompiler)
    630635, mLineBreak(nullptr)
    631636, mCRLF(nullptr)
Note: See TracChangeset for help on using the changeset viewer.