Ignore:
Timestamp:
Nov 7, 2016, 3:54:09 PM (3 years ago)
Author:
xwa163
Message:
  1. Extend Regex Syntax, include: (a) RL2.6 of UTS#18, support regex in property value. e.g. \p{script=/.*hir.*/} (b) Support syntax of property expression when parsing boundary. e.g. \b{greek} (c) Extend property expression in non capture group. e.g. (?\p{upper}:\p{greek}\p{script=hira})
  2. Add related test cases
File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.cpp

    r5204 r5206  
    120120   
    121121    Constant * matchProcessor;
    122     if (mIsNameExpression) {
    123         matchProcessor = m->getOrInsertFunction("insert_codepoints", Type::getVoidTy(ctxt), T, T, T, S, nullptr);
    124     } else {
    125         matchProcessor = m->getOrInsertFunction("wrapped_report_match", Type::getVoidTy(ctxt), T, T, T, S, T, T, nullptr);
     122    switch (mGrepType) {
     123        case GrepType::Normal:
     124            matchProcessor = m->getOrInsertFunction("wrapped_report_match", Type::getVoidTy(ctxt), T, T, T, S, T, T, nullptr);
     125            break;
     126        case GrepType::NameExpression:
     127            matchProcessor = m->getOrInsertFunction("insert_codepoints", Type::getVoidTy(ctxt), T, T, T, S, nullptr);
     128            break;
     129        case GrepType::PropertyValue:
     130            matchProcessor = m->getOrInsertFunction("insert_property_values", Type::getVoidTy(ctxt), T, T, T, S, nullptr);
     131            break;
     132
    126133    }
    127134    iBuilder->SetInsertPoint(BasicBlock::Create(ctxt, "entry", function,0));
     
    194201
    195202    Value * fileBuf = getScalarField(instance, "FileBuf");
    196     if (mIsNameExpression) {
    197         iBuilder->CreateCall(matchProcessor, std::vector<Value *>({matchRecordNum_phi, matchRecordStart_phi, matchRecordEnd, fileBuf}));
    198     } else {
    199         Value * fileSize = getScalarField(instance, "FileSize");
    200         Value * fileIdx = getScalarField(instance, "FileIdx");
    201         iBuilder->CreateCall(matchProcessor, std::vector<Value *>({matchRecordNum_phi, matchRecordStart_phi, matchRecordEnd, fileBuf, fileSize, fileIdx}));
     203    switch (mGrepType) {
     204        case GrepType::Normal:
     205        {
     206            Value * fileSize = getScalarField(instance, "FileSize");
     207            Value * fileIdx = getScalarField(instance, "FileIdx");
     208            iBuilder->CreateCall(matchProcessor, std::vector<Value *>({matchRecordNum_phi, matchRecordStart_phi, matchRecordEnd, fileBuf, fileSize, fileIdx}));
     209            break;
     210        }
     211        case GrepType::NameExpression:
     212        case GrepType::PropertyValue:
     213            iBuilder->CreateCall(matchProcessor, std::vector<Value *>({matchRecordNum_phi, matchRecordStart_phi, matchRecordEnd, fileBuf}));
     214            break;
    202215    }
    203216   
Note: See TracChangeset for help on using the changeset viewer.