Ignore:
Timestamp:
Sep 30, 2015, 12:26:23 PM (4 years ago)
Author:
nmedfort
Message:

Progress on multi-target UCD compilation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/generate_predefined_ucd_functions.cpp

    r4797 r4808  
    233233 * @brief compileUnicodeSet
    234234 ** ------------------------------------------------------------------------------------------------------------- */
    235 void compileUnicodeSet(std::string name, const UnicodeSet & set, PabloCompiler & pc, Module * module) {
     235void compileUnicodeSet(std::string name, UnicodeSet && set, PabloCompiler & pc, Module * module) {
    236236    #ifdef ENABLE_MULTIPLEXING
    237237    if (MultiplexingDistributionFile) {
     
    252252    // Build the unicode set function
    253253    PabloAST * result = nullptr;
     254    std::vector<UnicodeSet> sets;
     255    sets.push_back(std::move(set));
    254256    if (IfHierarchyStrategy == IfHierarchy::DefaultIfHierarchy) {
    255         result = ucdCompiler.generateWithDefaultIfHierarchy(set, builder);
     257        result = ucdCompiler.generateWithDefaultIfHierarchy(sets, builder).front();
    256258    } else if (IfHierarchyStrategy == IfHierarchy::NoIfHierarchy) {
    257         result = ucdCompiler.generateWithoutIfHierarchy(set, builder);
     259        result = ucdCompiler.generateWithoutIfHierarchy(sets, builder).front();
    258260    } else {
    259261        throw std::runtime_error("Unknown if hierarchy strategy!");
     
    391393        if (EnumeratedPropertyObject * enumObj = dyn_cast<EnumeratedPropertyObject>(obj)) {
    392394            for (const std::string value : *enumObj) {
    393                 const UnicodeSet & set = enumObj->GetCodepointSet(canonicalize_value_name(value));
     395                UnicodeSet set = enumObj->GetCodepointSet(canonicalize_value_name(value));
    394396                std::string name = "__get_" + property_enum_name[enumObj->getPropertyCode()] + "_" + value;
    395                 compileUnicodeSet(name, set, pc, module);
     397                compileUnicodeSet(name, std::move(set), pc, module);
    396398                properties.emplace_back(name);
    397399            }
     
    399401        else if (ExtensionPropertyObject * extObj = dyn_cast<ExtensionPropertyObject>(obj)) {
    400402            for (const std::string value : *extObj) {
    401                 const UnicodeSet & set = extObj->GetCodepointSet(canonicalize_value_name(value));
     403                UnicodeSet set = extObj->GetCodepointSet(canonicalize_value_name(value));
    402404                std::string name = "__get_" + property_enum_name[extObj->getPropertyCode()] + "_" + value;
    403                 compileUnicodeSet(name, set, pc, module);
     405                compileUnicodeSet(name, std::move(set), pc, module);
    404406                properties.emplace_back(name);
    405407            }
    406408        }
    407409        else if (BinaryPropertyObject * binObj = dyn_cast<BinaryPropertyObject>(obj)) {
    408             const UnicodeSet & set = binObj->GetCodepointSet(Binary_ns::Y);
     410            UnicodeSet set = binObj->GetCodepointSet(Binary_ns::Y);
    409411            std::string name = "__get_" + property_enum_name[binObj->getPropertyCode()] + "_Y";
    410             compileUnicodeSet(name, set, pc, module);
     412            compileUnicodeSet(name, std::move(set), pc, module);
    411413            properties.emplace_back(name);
    412414        }
Note: See TracChangeset for help on using the changeset viewer.