Ignore:
Timestamp:
Jun 30, 2015, 3:12:47 PM (4 years ago)
Author:
nmedfort
Message:

Temporary check-in for dynamic unicode class compilation.

File:
1 edited

Legend:

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

    r4625 r4626  
    2121#include <cc/cc_namemap.hpp>
    2222#include <pablo/codegenstate.h>
    23 #include <UCD/DerivedGeneralCategory.h>
     23#include <resolve_properties.h>
    2424#include <assert.h>
    2525#include <stdexcept>
     
    2929                                      "These options control the compilation of regular expressions to Pablo.");
    3030
    31 static cl::opt<bool> DisableLog2BoundedRepetition("disable-log2-bounded-repetition", cl::init(false), 
     31static cl::opt<bool> DisableLog2BoundedRepetition("disable-log2-bounded-repetition", cl::init(false),
    3232                     cl::desc("disable log2 optimizations for bounded repetition of bytes"), cl::cat(fREcompilationOptions));
    3333static cl::opt<int> IfInsertionGap("if-insertion-gap", cl::init(3), cl::desc("minimum number of nonempty elements between inserted if short-circuit tests"), cl::cat(fREcompilationOptions));
    34 static cl::opt<bool> DisableMatchStar("disable-matchstar", cl::init(false), 
     34static cl::opt<bool> DisableMatchStar("disable-matchstar", cl::init(false),
    3535                     cl::desc("disable MatchStar optimization"), cl::cat(fREcompilationOptions));
    3636static cl::opt<bool> DisableUnicodeMatchStar("disable-unicode-matchstar", cl::init(false),
     
    4141                     cl::desc("disable use of pregenerated Unicode character class sets"), cl::cat(fREcompilationOptions));
    4242
    43 
    4443using namespace pablo;
    4544
    4645namespace re {
    4746
     47bool IsPregeneratedUnicodeEnabled() {
     48    return !DisablePregeneratedUnicode;
     49}
    4850
    4951RE_Compiler::RE_Compiler(cc::CC_Compiler & ccCompiler)
     
    269271    }
    270272    else if (name->getType() == Name::Type::UnicodeProperty) {
    271         if (DisablePregeneratedUnicode) {
    272             // Note: using a fixed set while testing whether the UCD compiler works.
    273             var = mUCDCompiler.generateWithDefaultIfHierarchy(UCD::GC_ns::ll_Set, pb);
     273        if (IsPregeneratedUnicodeEnabled()) {
     274            var = mPB.createCall(name->getName());
    274275        }
    275276        else {
    276             var = mPB.createCall(name->getName());
     277            var = mUCDCompiler.generateWithDefaultIfHierarchy(resolveUnicodeSet(name), pb);
    277278        }
    278279    }
Note: See TracChangeset for help on using the changeset viewer.