Changeset 4732 for icGREP


Ignore:
Timestamp:
Aug 18, 2015, 5:47:47 PM (4 years ago)
Author:
cameron
Message:

icgrep linking

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

Legend:

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

    r4731 r4732  
    1414#include "pablo/pablo_compiler.h"
    1515#include <llvm/IR/Function.h>
     16#include <llvm/IR/Module.h>
    1617#include <llvm/ExecutionEngine/ExecutionEngine.h>
    1718#include <llvm/ExecutionEngine/MCJIT.h>
     
    2122#include <llvm/Support/TargetSelect.h>
    2223#include <llvm/Support/Host.h>
     24#ifndef DISABLE_PREGENERATED_UCD_FUNCTIONS
     25#include <UCD/precompiled_properties.h>
     26#endif
    2327
    2428#include "do_grep.h"
     
    7882
    7983void icgrep_Linking(Module * m, ExecutionEngine * e) {
    80     Function * printRegFn = m->getFunction("wrapped_print_register");
    81     if (printRegFn) {
    82         e->addGlobalMapping(cast<GlobalValue>(printRegFn), (void *)&wrapped_print_register);
     84    Module::FunctionListType & fns = m->getFunctionList();
     85    for (Module::FunctionListType::iterator it = fns.begin(), it_end = fns.end(); it != it_end; ++it) {
     86        std::string fnName = it->getName().str();
     87        if (fnName == "process_block") continue;
     88        if (fnName == "wrapped_print_register") {
     89            e->addGlobalMapping(cast<GlobalValue>(it), (void *)&wrapped_print_register);
     90        }
     91#ifndef DISABLE_PREGENERATED_UCD_FUNCTIONS
     92        else {
     93            const UCD::ExternalProperty & ep = UCD::resolveExternalProperty(fnName);
     94            e->addGlobalMapping(cast<GlobalValue>(it), std::get<0>(ep));
     95        }
     96#endif
    8397    }
    8498}
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r4729 r4732  
    142142            if (cd->maxNestingDepth <= nestedBlockData->maxNestingDepth) cd->maxNestingDepth = nestedBlockData->maxNestingDepth + 1;
    143143            cd->nested.entries++;
    144 #ifndef NDEBUG
     144#ifdef CARRY_DEBUG
    145145            nestedBlockData->dumpCarryData(cerr);
    146146#endif
     
    159159            if (cd->maxNestingDepth <= nestedBlockData->maxNestingDepth) cd->maxNestingDepth = nestedBlockData->maxNestingDepth + 1;
    160160            cd->nested.entries++;
    161 #ifndef NDEBUG
     161#ifdef CARRY_DEBUG
    162162            nestedBlockData->dumpCarryData(cerr);
    163163#endif
     
    179179        cd->summary.frameOffset = 0;
    180180    }
    181 #ifndef NDEBUG
     181#ifdef CARRY_DEBUG
    182182    if (cd->ifDepth == 0) cd->dumpCarryData(cerr);
    183183#endif
Note: See TracChangeset for help on using the changeset viewer.