Changeset 4508


Ignore:
Timestamp:
Feb 16, 2015, 12:13:08 PM (5 years ago)
Author:
cameron
Message:

Move to 1.0 numbering; eliminate LLVM3.4 support; -disable-Unicode-linebreak option

Location:
icGREP/icgrep-devel/icgrep
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r4480 r4508  
    55enable_testing()
    66# The version number.
    7 set (icgrep_VERSION_MAJOR 0)
    8 set (icgrep_VERSION_MINOR 8)
     7set (icgrep_VERSION_MAJOR 1)
     8set (icgrep_VERSION_MINOR 0)
    99
    1010option(BLOCK_SIZE_256 "Compiling with BLOCK_SIZE=256")
     
    244244
    245245# detect LLVM version and add compiler flags.
    246 if (${LLVM_PACKAGE_VERSION} MATCHES "3.4")
    247   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LLVM_3_4")
    248 ELSEIF (${LLVM_PACKAGE_VERSION} MATCHES "3.5")
     246IF (${LLVM_PACKAGE_VERSION} MATCHES "3.5")
    249247  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LLVM_3_5")
    250248ENDIF()
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r4486 r4508  
    3737                     cl::desc("disable Unicode MatchStar optimization"), cl::cat(fREcompilationOptions));
    3838
     39static cl::opt<bool> DisableUnicodeLineBreak("disable-Unicode-linebreak", cl::init(false),
     40                     cl::desc("disable Unicode line breaks - use LF only"), cl::cat(fREcompilationOptions));
     41
    3942
    4043using namespace pablo;
     
    5255
    5356}
    54    
     57
    5558   
    5659MarkerType RE_Compiler::AdvanceMarker(MarkerType m, MarkerPosition newpos, PabloBlock & pb) {
     
    7982}
    8083
    81 #define USE_IF_FOR_NONFINAL 1
    82 #define USE_IF_FOR_CRLF
    83 #define UNICODE_LINE_BREAK true
     84#define UNICODE_LINE_BREAK (!DisableUnicodeLineBreak)
    8485
    8586
     
    9091    PabloAST * CR = ccc.compileCC(makeCC(0x0D));
    9192    PabloAST * LF_VT_FF_CR = ccc.compileCC(makeCC(0x0A, 0x0D));
    92 #ifndef USE_IF_FOR_CRLF
    93     mCRLF = mPB.createAnd(mPB.createAdvance(CR, 1), mLineFeed);
    94 #else
     93
    9594    PabloBlock & crb = PabloBlock::Create(mPB);
    9695    PabloAST * cr1 = crb.createAdvance(CR, 1, "cr1");
     
    9897    mPB.createIf(CR, std::move(std::vector<Assign *>{acrlf}), crb);
    9998    mCRLF = acrlf;
    100 #endif
    101 
    102 #ifndef USE_IF_FOR_NONFINAL
    103     PabloAST * u8pfx2 = ccc.compileCC(makeCC(0xC2, 0xDF));
    104     PabloAST * u8pfx3 = ccc.compileCC(makeCC(0xE0, 0xEF));
    105     PabloAST * u8pfx4 = ccc.compileCC(makeCC(0xF0, 0xF4));
    106     PabloAST * u8pfx = mPB.createOr(mPB.createOr(u8pfx2, u8pfx3), u8pfx4);
    107     PabloAST * u8single = ccc.compileCC(makeCC(0x00, 0x7F));
    108     mInitial = mPB.createOr(u8pfx, u8single, "initial");
    109 
    110     PabloAST * u8scope32 = mPB.createAdvance(u8pfx3, 1);
    111     PabloAST * u8scope42 = mPB.createAdvance(u8pfx4, 1);
    112     PabloAST * u8scope43 = mPB.createAdvance(u8scope42, 1);
    113     PabloAST * NEL = mPB.createAnd(mPB.createAdvance(ccc.compileCC(makeCC(0xC2)), 1), ccc.compileCC(makeCC(0x85)));
    114     PabloAST * E2_80 = mPB.createAnd(mPB.createAdvance(ccc.compileCC(makeCC(0xE2)), 1), ccc.compileCC(makeCC(0x80)));
    115     PabloAST * LS_PS = mPB.createAnd(mPB.createAdvance(E2_80, 1), ccc.compileCC(makeCC(0xA8,0xA9)));
    116     PabloAST * LB_chars = mPB.createOr(LF_VT_FF_CR, mPB.createOr(NEL, LS_PS));
    117     mNonFinal = mPB.createAssign("nonfinal", mPB.createOr(mPB.createOr(u8pfx, u8scope32), mPB.createOr(u8scope42, u8scope43)));
    118     mUnicodeLineBreak = mPB.createAnd(LB_chars, mPB.createNot(mCRLF));  // count the CR, but not CRLF
    119 #endif
    120 
    121 #ifdef USE_IF_FOR_NONFINAL
     99
    122100    PabloAST * u8pfx = ccc.compileCC(makeCC(0xC0, 0xFF));
    123101    PabloBlock & it = PabloBlock::Create(mPB);
     
    140118    mInitial = mPB.createOr(u8single, valid_pfx, "initial");
    141119    mUnicodeLineBreak = mPB.createAnd(LB_chars, mPB.createNot(mCRLF));  // count the CR, but not CRLF
    142     #endif
    143120}
    144121
Note: See TracChangeset for help on using the changeset viewer.