Ignore:
Timestamp:
Dec 23, 2016, 1:14:39 PM (3 years ago)
Author:
nmedfort
Message:

Reverted last change to support gcc 4.9 prior to changing UCD property table structure.

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

Legend:

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

    r5234 r5236  
    1717namespace UCD {
    1818
    19 using PropertyStringStream =
    20     std::basic_stringstream<char, std::char_traits<char>, PropertyStringAllocator>;
    21 
    2219std::string canonicalize_value_name(const std::string & prop_or_val) {
    2320    std::locale loc;
     
    3532    throw std::runtime_error("Property " + value_spec + " unsupported.");
    3633}
    37 const PropertyString & PropertyObject::GetPropertyValueGrepString() {
     34const std::string & PropertyObject::GetPropertyValueGrepString() {
    3835    throw std::runtime_error("Property Value Grep String unsupported.");
    3936}
     
    8077    }
    8178    return enumeration_basis_sets;
    82 };
     79}
    8380
    84 const PropertyString &EnumeratedPropertyObject::GetPropertyValueGrepString() {
    85     if (LLVM_LIKELY(property_value_grep_string.empty())) {
    86         PropertyStringStream buffer;
     81const std::string & EnumeratedPropertyObject::GetPropertyValueGrepString() {
     82    if (LLVM_LIKELY(mPropertyValueGrepString.empty())) {
     83        std::stringstream buffer;
    8784        for (unsigned i = 0; i != property_value_full_names.size(); i++) {
    8885            buffer << canonicalize_value_name(property_value_full_names[i]) + "\n";
     
    9188            buffer << canonicalize_value_name(property_value_enum_names[i]) + "\n";
    9289        }
    93         property_value_grep_string.assign(buffer.str());
     90        mPropertyValueGrepString = buffer.str();
    9491    }
    95     return property_value_grep_string;
     92    return mPropertyValueGrepString;
    9693}
    9794
     
    145142}
    146143
    147 const PropertyString & ExtensionPropertyObject::GetPropertyValueGrepString() {
     144const std::string & ExtensionPropertyObject::GetPropertyValueGrepString() {
    148145    return property_object_table[base_property]->GetPropertyValueGrepString();
    149146}
     
    172169}
    173170
    174 const PropertyString & BinaryPropertyObject::GetPropertyValueGrepString() {
    175     if (property_value_grep_string.empty()) {
    176         PropertyStringStream buffer;
     171const std::string & BinaryPropertyObject::GetPropertyValueGrepString() {
     172    if (mPropertyValueGrepString.empty()) {
     173        std::stringstream buffer;
    177174        for (const auto & prop : Binary_ns::aliases_only_map) {
    178175            buffer << std::get<0>(prop) + "\n";
    179176        }
    180         property_value_grep_string.assign(buffer.str());
     177        mPropertyValueGrepString = buffer.str();
    181178    }
    182     return property_value_grep_string;
     179    return mPropertyValueGrepString;
    183180}
    184181
  • icGREP/icgrep-devel/icgrep/UCD/PropertyObjects.h

    r5235 r5236  
    1414#include <vector>
    1515#include <unordered_map>
    16 #include <util/aligned_allocator.h>
    1716
    1817namespace UCD {
    19 
    20 using PropertyStringAllocator = AlignedAllocator<char, 32>;
    21 
    22 using PropertyString =
    23     std::basic_string<char, std::char_traits<char>, PropertyStringAllocator>;
    2418
    2519std::string canonicalize_value_name(const std::string & prop_or_val);
     
    4842    PropertyObject(property_t p, ClassTypeId k) : the_property(p), the_kind(k) {}
    4943    virtual int GetPropertyValueEnumCode(const std::string & value_spec);
    50     virtual const PropertyString & GetPropertyValueGrepString();
     44    virtual const std::string & GetPropertyValueGrepString();
    5145    property_t the_property;
    5246    ClassTypeId the_kind;
     
    9690
    9791    virtual int GetPropertyValueEnumCode(const std::string & value_spec);
    98     virtual const PropertyString & GetPropertyValueGrepString();
     92    virtual const std::string & GetPropertyValueGrepString();
    9993    const UnicodeSet & GetCodepointSet(const std::string & value_spec);
    10094    const UnicodeSet & GetCodepointSet(const int property_enum_val) const;
     
    107101    }
    108102
    109      iterator end() const {
     103    iterator end() const {
    110104        return property_value_enum_names.cend();
    111105    }
     
    116110    const std::vector<std::string> & property_value_full_names;  // never changes
    117111    std::unordered_map<std::string, int> & property_value_aliases;
    118     PropertyString property_value_grep_string;
     112    std::string mPropertyValueGrepString;
    119113    bool uninitialized; // full names must be added dynamically.
    120114    const std::vector<const UnicodeSet *> property_value_sets;
     
    146140
    147141    virtual int GetPropertyValueEnumCode(const std::string & value_spec);
    148     virtual const PropertyString & GetPropertyValueGrepString();
     142    virtual const std::string & GetPropertyValueGrepString();
    149143    const UnicodeSet & GetCodepointSet(const std::string & value_spec);
    150144    const UnicodeSet & GetCodepointSet(const int property_enum_val) const;
     
    172166    const UnicodeSet & GetCodepointSet(const std::string & value_spec);
    173167    const UnicodeSet & GetCodepointSet(const int property_enum_val);
    174     virtual const PropertyString & GetPropertyValueGrepString();
     168    virtual const std::string & GetPropertyValueGrepString();
    175169private:
    176170    bool mNoUninitialized;
    177171    UnicodeSet mY;
    178172    UnicodeSet mN;
    179     PropertyString property_value_grep_string;
     173    std::string mPropertyValueGrepString;
    180174};
    181175
  • icGREP/icgrep-devel/icgrep/UCD/resolve_properties.cpp

    r5234 r5236  
    220220}
    221221
    222 const PropertyString & getPropertyValueGrepString(const std::string & prop) {
     222const std::string & getPropertyValueGrepString(const std::string & prop) {
    223223    auto propit = alias_map.find(canonicalize_value_name(prop));
    224224    if (propit == alias_map.end()) {
  • icGREP/icgrep-devel/icgrep/UCD/resolve_properties.h

    r5234 r5236  
    2727std::string resolvePropertyFunction(re::Name * const property);
    2828UCD::UnicodeSet resolveUnicodeSet(re::Name * const name);
    29 const PropertyString & getPropertyValueGrepString(const std::string & prop);
     29const std::string & getPropertyValueGrepString(const std::string & prop);
    3030
    3131}
Note: See TracChangeset for help on using the changeset viewer.