Ignore:
Timestamp:
May 10, 2017, 4:26:11 PM (2 years ago)
Author:
nmedfort
Message:

Large refactoring step. Removed IR generation code from Kernel (formally KernelBuilder?) and moved it into the new KernelBuilder? class.

File:
1 edited

Legend:

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

    r5438 r5440  
    126126}
    127127
    128 void KernelInterface::addKernelDeclarations() {
     128void KernelInterface::addKernelDeclarations(const std::unique_ptr<kernel::KernelBuilder> & idb) {
    129129
    130130    if (mKernelStateType == nullptr) {
     
    132132    }
    133133
    134     Module * const module = iBuilder->getModule();
     134    Module * const module = idb->getModule();
    135135    PointerType * const selfType = mKernelStateType->getPointerTo();
    136     IntegerType * const sizeTy = iBuilder->getSizeTy();
     136    IntegerType * const sizeTy = idb->getSizeTy();
    137137    PointerType * const consumerTy = StructType::get(sizeTy, sizeTy->getPointerTo()->getPointerTo(), nullptr)->getPointerTo();
    138     Type * const voidTy = iBuilder->getVoidTy();
     138    Type * const voidTy = idb->getVoidTy();
    139139
    140140    // Create the initialization function prototype
     
    155155    }
    156156    for (auto binding : mStreamSetOutputs) {
    157         (args++)->setName(binding.name + "ConsumerLocks");
     157        (++args)->setName(binding.name + "ConsumerLocks");
    158158    }
    159159
    160160    // Create the doSegment function prototype.
    161     std::vector<Type *> params = {selfType, iBuilder->getInt1Ty()};
     161    std::vector<Type *> params = {selfType, idb->getInt1Ty()};
    162162    params.insert(params.end(), mStreamSetInputs.size(), sizeTy);
    163163
     
    177177    Type * resultType = nullptr;
    178178    if (mScalarOutputs.empty()) {
    179         resultType = iBuilder->getVoidTy();
     179        resultType = idb->getVoidTy();
    180180    } else {
    181181        const auto n = mScalarOutputs.size();
     
    187187            resultType = outputType[0];
    188188        } else {
    189             resultType = StructType::get(iBuilder->getContext(), ArrayRef<Type *>(outputType, n));
     189            resultType = StructType::get(idb->getContext(), ArrayRef<Type *>(outputType, n));
    190190        }
    191191    }
     
    198198    args->setName("self");
    199199
    200     linkExternalMethods();
     200    linkExternalMethods(idb);
    201201}
    202202
Note: See TracChangeset for help on using the changeset viewer.