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.

Location:
icGREP/icgrep-devel/icgrep/re
Files:
3 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    }
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r4681 r4684  
    1212#include <cc/cc_compiler.h>
    1313#include <pablo/builder.hpp>
    14 #include <UCD/ucd_compiler.hpp>
    1514#include <string>
    1615#include <list>
     
    3938
    4039namespace re {
    41 
    42 bool UsePregeneratedUnicode();
    4340
    4441enum MarkerPosition {FinalMatchByte, InitialPostPositionByte, FinalPostPositionByte};
     
    104101    std::vector<pablo::Next *>                      mLoopVariants; // <- rethink name
    105102    pablo::PabloBuilder                             mPB;
    106     UCD::UCDCompiler                                mUCDCompiler;
    107103    pablo::PabloFunction &                          mFunction;
    108104};
  • icGREP/icgrep-devel/icgrep/re/re_nullable.cpp

    r4249 r4684  
    11#include "re_nullable.h"
    2 #include "re_cc.h"
    3 #include "re_start.h"
    4 #include "re_end.h"
    5 #include "re_alt.h"
    6 #include "re_rep.h"
    7 #include "re_simplifier.h"
    8 #include <printer_re.h>
     2#include <re/re_cc.h>
     3#include <re/re_start.h>
     4#include <re/re_end.h>
     5#include <re/re_alt.h>
     6#include <re/re_rep.h>
     7#include <re/re_simplifier.h>
     8#include <re/printer_re.h>
    99#include <iostream>
    1010/*
Note: See TracChangeset for help on using the changeset viewer.