Ignore:
Timestamp:
Jul 18, 2015, 10:18:34 AM (4 years ago)
Author:
nmedfort
Message:

First attempt to intergrate 'generate_predefined_ucd_functions' into build process.

File:
1 edited

Legend:

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

    r4681 r4684  
    2121#include <cc/cc_namemap.hpp>
    2222#include <pablo/codegenstate.h>
     23#include <UCD/ucd_compiler.hpp>
     24#include <UCD/precompiled_properties.h>
    2325#include <UCD/resolve_properties.h>
    2426#include <assert.h>
     
    4042static cl::opt<bool> DisablePregeneratedUnicode("disable-pregenerated-unicode", cl::init(false),
    4143                     cl::desc("disable use of pregenerated Unicode character class sets"), cl::cat(fREcompilationOptions));
    42 
    4344using namespace pablo;
    4445
    4546namespace re {
    46 
    47 bool UsePregeneratedUnicode() {
    48     return !DisablePregeneratedUnicode;
    49 }
    5047
    5148RE_Compiler::RE_Compiler(pablo::PabloFunction & function, cc::CC_Compiler & ccCompiler)
     
    6158, mLoopVariants()
    6259, mPB(*ccCompiler.getBuilder().getPabloBlock(), ccCompiler.getBuilder())
    63 , mUCDCompiler(ccCompiler)
    6460, mFunction(function)
    6561{
     
    275271    }
    276272    else if (name->getType() == Name::Type::UnicodeProperty) {
    277         if (UsePregeneratedUnicode()) {
    278             var = pb.createCall(Prototype::Create(name->getFunctionName(), 8, 1, 0), mCCCompiler.getBasisBits());
     273        if (DisablePregeneratedUnicode) {
     274            UCD::UCDCompiler ucdCompiler(mCCCompiler);
     275            var = ucdCompiler.generateWithDefaultIfHierarchy(UCD::resolveUnicodeSet(name), pb);
    279276        }
    280277        else {
    281             var = mUCDCompiler.generateWithDefaultIfHierarchy(UCD::resolveUnicodeSet(name), pb);
     278            const UCD::ExternalProperty & ep = UCD::resolveExternalProperty(name->getFunctionName());
     279            var = pb.createCall(Prototype::Create(name->getFunctionName(), std::get<1>(ep), std::get<2>(ep), std::get<3>(ep), std::get<0>(ep)), mCCCompiler.getBasisBits());
    282280        }
    283281    }
Note: See TracChangeset for help on using the changeset viewer.