Ignore:
Timestamp:
Jul 5, 2017, 10:34:41 AM (2 years ago)
Author:
cameron
Message:

Decouple finalizeMatchResults, creating separate MatchedLinesKernel?

Location:
icGREP/icgrep-devel/icgrep/re
Files:
3 edited

Legend:

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

    r5413 r5548  
    198198}
    199199
    200 void RE_Compiler::finalizeMatchResult(MarkerType match_result) {
    201     PabloAST * match_follow = mPB.createMatchStar(markerVar(match_result), mAny);
    202     PabloAST * matches = mPB.createAnd(match_follow, mLineBreak, "matchedLine3s");
     200void RE_Compiler::compile(RE * re) {
     201    MarkerType match_results = compile(re, mPB);
    203202    Var * const output = mKernel->getOutputStreamVar("matches");
    204     mPB.createAssign(mPB.createExtract(output, mPB.getInteger(0)), matches);
    205 }
    206 
     203    mPB.createAssign(mPB.createExtract(output, mPB.getInteger(0)), markerVar(match_results));
     204}
     205   
    207206MarkerType RE_Compiler::compile(RE * re, PabloBuilder & pb) {
    208207    return process(re, makeMarker(MarkerPosition::FinalPostPositionUnit, pb.createOnes()), pb);
    209208}
    210 
     209   
    211210MarkerType RE_Compiler::process(RE * re, MarkerType marker, PabloBuilder & pb) {
    212211    if (isa<Name>(re)) {
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r5413 r5548  
    6363    void initializeRequiredStreams(const unsigned encodingBits, pablo::Var * linebreak);
    6464    void compileUnicodeNames(RE *& re);
    65     void finalizeMatchResult(MarkerType match_result);
    66     MarkerType compile(RE * re) {
    67         return compile(re, mPB);
    68     }
     65    void compile(RE * re);
    6966
    7067    static LLVM_ATTRIBUTE_NORETURN void UnsupportedRE(std::string errmsg);
  • icGREP/icgrep-devel/icgrep/re/re_toolchain.cpp

    r5493 r5548  
    9898    re_compiler.initializeRequiredStreams(basis->getType()->getArrayNumElements(), linebreak);
    9999    re_compiler.compileUnicodeNames(re_ast);
    100     re_compiler.finalizeMatchResult(re_compiler.compile(re_ast));
     100    re_compiler.compile(re_ast);
    101101}
    102102
Note: See TracChangeset for help on using the changeset viewer.