Ignore:
Timestamp:
Jul 30, 2016, 1:12:45 PM (3 years ago)
Author:
cameron
Message:

DoBlock/FinalBlock/DoSegment? Kernel functions always return void; clean-up

File:
1 edited

Legend:

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

    r5109 r5111  
    6969   
    7070void p2sKernel_withCompressedOutput::prepareKernel() {
    71     setDoBlockReturnType(iBuilder->getInt32Ty());
    7271    KernelBuilder::prepareKernel();
    7372}
     
    107106        offset = iBuilder->CreateZExt(iBuilder->CreateExtractElement(unit_counts, iBuilder->getInt32(j)), i32);
    108107    }
    109     iBuilder->CreateRet(offset);
     108    iBuilder->CreateRetVoid();
    110109    iBuilder->restoreIP(savePoint);
    111110}
     
    153152}
    154153   
    155     static Function * create_write(Module * const mod) {
    156         Function * write = mod->getFunction("write");
    157         if (write == nullptr) {
    158             FunctionType *write_type =
    159             TypeBuilder<long(int, char *, long), false>::get(mod->getContext());
    160             write = cast<Function>(mod->getOrInsertFunction("write", write_type,
    161                                                             AttributeSet().addAttribute(mod->getContext(), 2U, Attribute::NoAlias)));
    162         }
    163         return write;
    164     }
     154static Function * create_write(Module * const mod) {
     155    Function * write = mod->getFunction("write");
     156    if (write == nullptr) {
     157        FunctionType *write_type =
     158        TypeBuilder<long(int, char *, long), false>::get(mod->getContext());
     159        write = cast<Function>(mod->getOrInsertFunction("write", write_type,
     160                                                        AttributeSet().addAttribute(mod->getContext(), 2U, Attribute::NoAlias)));
     161    }
     162    return write;
     163}
    165164   
    166165   
     
    244243    IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
    245244    Module * m = iBuilder->getModule();
    246     Type * i32 = iBuilder->getIntNTy(32);
    247245    Type * bitBlockPtrTy = llvm::PointerType::get(iBuilder->getBitBlockType(), 0);
    248246    Type * i8PtrTy = iBuilder->getInt8PtrTy();
Note: See TracChangeset for help on using the changeset viewer.