Ignore:
Timestamp:
Aug 7, 2014, 4:40:07 PM (5 years ago)
Author:
daled
Message:

A change to the way unicode categories are handled. This version supports the unicode categlry 'Nd'.

File:
1 edited

Legend:

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

    r3965 r3969  
    88#include "printer_pablos.h"
    99
     10Nd nd;
     11
    1012extern "C" {
    1113  void wrapped_print_register(BitBlock bit_block) {
     
    1517
    1618extern "C" {
    17     BitBlock wrapped_get_unicode_category(Basis_bits &basis_bits, const char* name){
    18         return Unicode_Categories::getCategory(basis_bits, name);
    19     }
    20 }
    21 
    22 BitBlock LLVM_Generator::Get_UnicodeCategory(Basis_bits &basis_bits, const char *name)
    23 {
    24     return Unicode_Categories::getCategory(basis_bits, name);
    25 }
    26 
    27 void LLVM_Generator::Print_Register(char *name, BitBlock bit_block)
    28 {
    29     print_register<BitBlock>(name, bit_block);
     19    BitBlock wrapped_get_category_Nd(Basis_bits &basis_bits, const char* name){
     20
     21        Struct_Nd nd_output;
     22        nd.do_block(basis_bits, nd_output);
     23
     24        return nd_output.cc;
     25    }
    3026}
    3127
     
    202198void LLVM_Generator::DeclareFunctions()
    203199{
    204     mFunc_get_unicode_category = mMod->getOrInsertFunction("wrapped_get_unicode_category", m64x2Vect, mStruct_Basis_Bits_Ptr1, Type::getInt8PtrTy(mMod->getContext()), NULL);
    205     mExecutionEngine->addGlobalMapping(cast<GlobalValue>(mFunc_get_unicode_category), (void *)&wrapped_get_unicode_category);
     200    mFunc_get_unicode_category_Nd = mMod->getOrInsertFunction("wrapped_get_category_Nd", m64x2Vect, mStruct_Basis_Bits_Ptr1, Type::getInt8PtrTy(mMod->getContext()), NULL);
     201    mExecutionEngine->addGlobalMapping(cast<GlobalValue>(mFunc_get_unicode_category_Nd), (void *)&wrapped_get_category_Nd);
     202
     203    //mFunc_get_unicode_category = mMod->getOrInsertFunction("wrapped_get_unicode_category", m64x2Vect, mStruct_Basis_Bits_Ptr1, Type::getInt8PtrTy(mMod->getContext()), NULL);
     204    //mExecutionEngine->addGlobalMapping(cast<GlobalValue>(mFunc_get_unicode_category), (void *)&wrapped_get_unicode_category);
    206205
    207206    //This function can be used for testing to print the contents of a register from JIT'd code to the terminal window.
     
    414413        {
    415414            Value* basis_bits_struct = b.CreateLoad(mPtr_basis_bits_addr);
    416             Value* unicode_category = b.CreateCall2(mFunc_get_unicode_category, basis_bits_struct, b.CreateGlobalStringPtr(call->getCallee()));
     415            Value* unicode_category = b.CreateCall2(mFunc_get_unicode_category_Nd, basis_bits_struct, b.CreateGlobalStringPtr(call->getCallee()));
     416            //b.CreateCall(mFunc_print_register, unicode_category);
    417417            Value* ptr = b.CreateAlloca(m64x2Vect);
    418418            Value* void_1 = b.CreateStore(unicode_category, ptr);
     
    422422        std::map<std::string, Value*>::iterator itGet = mMarkerMap.find(call->getCallee());
    423423        Value * var_value = b.CreateLoad(itGet->second);
     424
    424425
    425426        retVal = var_value;
Note: See TracChangeset for help on using the changeset viewer.