Ignore:
Timestamp:
Nov 28, 2017, 1:45:19 AM (17 months ago)
Author:
nmedfort
Message:

Bug fix for segment pipeline parallel mode + memory management improvements.

File:
1 edited

Legend:

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

    r5736 r5748  
    1313#include <boost/container/flat_set.hpp>
    1414#include <boost/range/adaptor/reversed.hpp>
     15#include <util/slab_allocator.h>
    1516#include <map>
    1617
     
    156157}
    157158
    158 bool RE_Local::isLocalLanguage(RE * re) {
    159     UCD::UnicodeSet seen = UCD::UnicodeSet();
     159bool RE_Local::isLocalLanguage(RE * re) {   
     160    UCD::UnicodeSet seen;
    160161    return isLocalLanguage_helper(re, seen);
    161162}
     
    165166    if (isa<Any>(re)) {
    166167        const bool no_intersect = seen.empty();
    167         seen = UCD::UnicodeSet(0x00, 0x10FFFF);
     168        seen.insert_range(0x00, 0x10FFFF);
    168169        return no_intersect;
    169170    } else if (const CC * cc = dyn_cast<CC>(re)) {
    170         const bool has_intersect = cast<CC>(cc)->intersects(seen);
    171         seen = seen + *cast<CC>(cc);
     171        const bool has_intersect = cc->intersects(seen);
     172        seen = seen + *cc;
    172173        return !has_intersect;
    173174    } else if (const Name * n = dyn_cast<Name>(re)) {
    174175        return isLocalLanguage_helper(n->getDefinition(), seen);
    175     } else if (const Seq * re_seq = dyn_cast<const Seq>(re)) {
    176         for (const RE * item : *re_seq) {
     176    } else if (const Seq * seq = dyn_cast<Seq>(re)) {
     177        for (const RE * item : *seq) {
    177178            if (!isLocalLanguage_helper(item, seen)) return false;
    178179        }
    179180        return true;
    180     } else if (const Alt * re_alt = dyn_cast<const Alt>(re)) {
    181         for (RE * item : *re_alt) {
     181    } else if (const Alt * alt = dyn_cast<Alt>(re)) {
     182        for (RE * item : *alt) {
    182183            if (!isLocalLanguage_helper(item, seen)) return false;
    183184        }
    184185        return true;
    185     } else if (const Rep* re_rep = dyn_cast<const Rep>(re)) {
    186         if (re_rep->getUB() > 1) return false;
    187         return isLocalLanguage_helper(re_rep->getRE(), seen);
     186    } else if (const Rep * rep = dyn_cast<Rep>(re)) {
     187        if (rep->getUB() > 1) return false;
     188        return isLocalLanguage_helper(rep->getRE(), seen);
    188189    } else {
    189190        // A local language cannot contain Intersects, Differences, Assertions, Start, End.
Note: See TracChangeset for help on using the changeset viewer.