Ignore:
Timestamp:
Dec 21, 2016, 3:53:58 PM (3 years ago)
Author:
nmedfort
Message:

Bug fixes for Carry Manager and issues reported by Fahad

Location:
icGREP/icgrep-devel/icgrep/UCD
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/PropertyObjects.cpp

    r5206 r5233  
    5858std::vector<UnicodeSet> & EnumeratedPropertyObject::GetEnumerationBasisSets() {
    5959    // Return the previously computed vector of basis sets, if it exists.
    60     if (enumeration_basis_sets.size() > 0) return enumeration_basis_sets;
    61    
    62     // Otherwise compute and return.
    63     // Basis set i is the set of all codepoints whose numerical enumeration code e
    64     // has bit i set, i.e., (e >> i) & 1 == 1.
    65     unsigned basis_count = 1;
    66     while ((1 << basis_count) < independent_enum_count) basis_count++;
    67     for (unsigned i = 0; i < basis_count; i++) {
    68         enumeration_basis_sets.push_back(UnicodeSet());
    69         for (unsigned e = 0; e < independent_enum_count; e++) {
    70             if (((e >> i) & 1) == 0) {
    71                 enumeration_basis_sets[i] = enumeration_basis_sets[i] + *property_value_sets[e];
     60    if (LLVM_UNLIKELY(enumeration_basis_sets.empty())) {
     61        // Otherwise compute and return.
     62        // Basis set i is the set of all codepoints whose numerical enumeration code e
     63        // has bit i set, i.e., (e >> i) & 1 == 1.
     64        unsigned basis_count = 1;
     65        while ((1 << basis_count) < independent_enum_count) basis_count++;
     66        for (unsigned i = 0; i < basis_count; i++) {
     67            enumeration_basis_sets.push_back(UnicodeSet());
     68            for (unsigned e = 0; e < independent_enum_count; e++) {
     69                if (((e >> i) & 1) == 0) {
     70                    enumeration_basis_sets[i] = enumeration_basis_sets[i] + *property_value_sets[e];
     71                }
    7272            }
    7373        }
  • icGREP/icgrep-devel/icgrep/UCD/resolve_properties.cpp

    r5206 r5233  
    3939#define Ahead(x) makeLookAheadAssertion(x)
    4040
    41     RE * GCB_Control = makeName("gcb", "cn", Name::Type::UnicodeProperty);
     41//    RE * GCB_Control = makeName("gcb", "cn", Name::Type::UnicodeProperty);
    4242    RE * GCB_CR = makeName("gcb", "cr", Name::Type::UnicodeProperty);
    4343    RE * GCB_LF = makeName("gcb", "lf", Name::Type::UnicodeProperty);
Note: See TracChangeset for help on using the changeset viewer.