Ignore:
Timestamp:
Jul 14, 2015, 12:20:32 AM (4 years ago)
Author:
nmedfort
Message:

Force UnsupportedPropertyObject? kind to be UnsupportedProperty?.

File:
1 edited

Legend:

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

    r4666 r4667  
    3535#include "llvm/Support/FileSystem.h"
    3636#include <llvm/Transforms/Scalar.h>
    37 
    38 
    3937#include <boost/algorithm/string/case_conv.hpp>
    4038#include <iostream>
     
    5250static cl::opt<std::string>
    5351OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"));
     52
     53#ifdef ENABLE_MULTIPLEXING
     54static cl::opt<bool> EnableMultiplexing("multiplexing", cl::init(false),
     55                                        cl::desc("combine Advances whose inputs are mutual exclusive into the fewest number of advances possible (expensive)."));
     56#endif
    5457
    5558/** ------------------------------------------------------------------------------------------------------------- *
     
    6265    UCDCompiler ucdCompiler(ccCompiler);
    6366    PabloBuilder builder(function.getEntryBlock());
     67
     68    std::cerr << "Compiling " << name << std::endl;
     69
    6470    // Build the unicode set function
    6571    ucdCompiler.generateWithDefaultIfHierarchy(set, builder);
     
    6874    CodeSinking::optimize(function);
    6975    #ifdef ENABLE_MULTIPLEXING
    70     AutoMultiplexing::optimize(function);
     76    if (EnableMultiplexing) {
     77        AutoMultiplexing::optimize(function);
     78    }
    7179    #endif
    7280    // Now compile the function ...
     
    8391    for (PropertyObject * obj : property_object_table) {
    8492
    85         if (isa<UnsupportedPropertyObject>(obj)) continue;
    86 
    87         if (auto * enumObj = dyn_cast<EnumeratedPropertyObject>(obj)) {
     93        if (EnumeratedPropertyObject * enumObj = dyn_cast<EnumeratedPropertyObject>(obj)) {
    8894            for (const std::string value : *enumObj) {
    8995                const UnicodeSet & set = enumObj->GetCodepointSet(canonicalize_value_name(value));
    90                 std::string name = "__get_" + property_enum_name[enumObj->getPropertyCode()] + "_" + lowercase(value);
    91                 compileUnicodeSet(name, set, pc, module);
    92             }
    93             break;
    94         }
    95         else if (auto * extObj = dyn_cast<ExtensionPropertyObject>(obj)) {
    96             for (const std::string value : *extObj) {
    97                 const UnicodeSet & set = extObj->GetCodepointSet(canonicalize_value_name(value));
    98                 std::string name = "__get_" + property_enum_name[extObj->getPropertyCode()] + "_" + lowercase(value);
     96                std::string name = "__get_" + property_enum_name[enumObj->getPropertyCode()] + "_" + value;
    9997                compileUnicodeSet(name, set, pc, module);
    10098            }
    10199        }
    102         else if (auto * binObj = dyn_cast<BinaryPropertyObject>(obj)) {
     100        else if (ExtensionPropertyObject * extObj = dyn_cast<ExtensionPropertyObject>(obj)) {
     101            for (const std::string value : *extObj) {
     102                const UnicodeSet & set = extObj->GetCodepointSet(canonicalize_value_name(value));
     103                std::string name = "__get_" + property_enum_name[extObj->getPropertyCode()] + "_" + value;
     104                compileUnicodeSet(name, set, pc, module);
     105            }
     106        }
     107        else if (BinaryPropertyObject * binObj = dyn_cast<BinaryPropertyObject>(obj)) {
    103108            const UnicodeSet & set = binObj->GetCodepointSet(Binary_ns::Y);
    104             std::string name = "__get_" + property_enum_name[binObj->getPropertyCode()] + "_y";
     109            std::string name = "__get_" + property_enum_name[binObj->getPropertyCode()] + "_Y";
    105110            compileUnicodeSet(name, set, pc, module);
    106111        }
     112
    107113    }
    108114
Note: See TracChangeset for help on using the changeset viewer.