Ignore:
Timestamp:
Sep 21, 2017, 3:10:34 PM (18 months ago)
Author:
nmedfort
Message:

Minor clean up. Bug fix for object cache when the same cached kernel is used twice in a single run. Improvement to RE Minimizer.

File:
1 edited

Legend:

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

    r5638 r5646  
    5555}
    5656
    57 void RE_Compiler::compileUnicodeNames(RE *& re) {
    58     re = resolveUnicodeProperties(re);
    59 }
    60 
    61 void RE_Compiler::compile(RE * re) {
    62     MarkerType match_results = compile(re, mPB);
    63     PabloAST * match_post = markerVar(AdvanceMarker(match_results, MarkerPosition::FinalPostPositionUnit, mPB));
    64     Var * const output = mKernel->getOutputStreamVar("matches");
    65    
    66     mPB.createAssign(mPB.createExtract(output, mPB.getInteger(0)), match_post);
     57RE * RE_Compiler::compileUnicodeNames(RE * re) {
     58    return resolveUnicodeProperties(re);
     59}
     60
     61PabloAST * RE_Compiler::compile(RE * re) {
     62    return markerVar(AdvanceMarker(compile(re, mPB), MarkerPosition::FinalPostPositionUnit, mPB));
    6763}
    6864   
     
    9591        pablo_follow = pb.createOr(pablo_follow, follow);
    9692    }
    97     PabloAST * result = pb.createAnd(pb.createMatchStar(pb.createAdvance(pablo_first, 1), pb.createOr(pablo_follow, mNonFinal)), pb.createAdvance(pablo_final, 1));
     93    PabloAST * result = pb.createAnd(pb.createMatchStar(pb.createAdvance(pablo_first, 1),
     94                                                        pb.createOr(pablo_follow, mNonFinal)),
     95                                     pb.createAdvance(pablo_final, 1));
    9896    return makeMarker(MarkerPosition::FinalPostPositionUnit, result);
    9997}
     
    110108        } else if (isa<Intersect>(re)) {
    111109            return compileIntersect(cast<Intersect>(re), marker, pb);
    112         }
    113         UnsupportedRE("RE Compiler for local language failed to process " + Printer_RE::PrintRE(re));
     110        } else {
     111            UnsupportedRE("RE Compiler for local language failed to process " + Printer_RE::PrintRE(re));
     112        }
    114113    } else {
    115114        if (isa<Name>(re)) {
     
    136135            // CCs may be passed through the toolchain directly to the compiler.
    137136            return compileCC(cast<CC>(re), marker, pb);
    138         }
    139         UnsupportedRE("RE Compiler failed to process " + Printer_RE::PrintRE(re));
     137        } else {
     138            UnsupportedRE("RE Compiler failed to process " + Printer_RE::PrintRE(re));
     139        }
    140140    }
    141141}
Note: See TracChangeset for help on using the changeset viewer.