Changeset 5557 for icGREP/icgrep-devel


Ignore:
Timestamp:
Jul 9, 2017, 9:23:20 AM (2 years ago)
Author:
cameron
Message:

Support for CCs in regexp analysis

File:
1 edited

Legend:

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

    r5267 r5557  
    3535    } else if (const Intersect * e = dyn_cast<Intersect>(re)) {
    3636        return isByteLength(e->getLH()) && isByteLength(e->getRH());
     37    } else if (isa<CC>(re)) {
     38        return cast<CC>(re) < makeCC(0, 0x7F);
    3739    } else if (const Name * n = dyn_cast<Name>(re)) {
    3840        if (n->getType() == Name::Type::Byte) {
     
    6567        return isUnicodeUnitLength(e->getLH()) && isUnicodeUnitLength(e->getRH());
    6668    } else if (isa<Any>(re)) {
     69        return true;
     70    } else if (isa<CC>(re)) {
    6771        return true;
    6872    } else if (const Name * n = dyn_cast<Name>(re)) {
     
    126130        const auto r2 = getUnicodeUnitLengthRange(i->getRH());
    127131        return std::make_pair(std::min(r1.first, r2.first), std::max(r1.second, r2.second));
     132    } else if (isa<CC>(re)) {
     133        return std::make_pair(1, 1);
    128134    } else if (const Name * n = dyn_cast<Name>(re)) {
    129135        // Eventually names might be set up for not unit length items.
     
    169175    } else if (isa<Any>(re)) {
    170176        return 1;
     177    } else if (isa<CC>(re)) {
     178        return 1;
    171179    } else if (const Name * n = dyn_cast<Name>(re)) {
    172180        // Eventually names might be set up for not unit length items.
Note: See TracChangeset for help on using the changeset viewer.