Ignore:
Timestamp:
Nov 7, 2016, 12:08:13 PM (3 years ago)
Author:
nmedfort
Message:

More 32-bit fixes.

File:
1 edited

Legend:

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

    r5202 r5204  
    66#include <kernels/kernel.h>
    77#include <IDISA/idisa_builder.h>
    8 #include <llvm/IR/TypeBuilder.h>
    98
    109namespace kernel {
    1110
    12 static Function * create_write(Module * const mod) {
     11static Function * create_write(Module * const mod, IDISA::IDISA_Builder * builder) {
    1312    Function * write = mod->getFunction("write");
    1413    if (write == nullptr) {
    15         FunctionType *write_type =
    16         TypeBuilder<long(int, char *, long), false>::get(mod->getContext());
    17         write = cast<Function>(mod->getOrInsertFunction("write", write_type,
    18                                                          AttributeSet().addAttribute(mod->getContext(), 2U, Attribute::NoAlias)));
     14        IntegerType * sizeTy = builder->getSizeTy();
     15        IntegerType * int32Ty = builder->getInt32Ty();
     16        PointerType * int8PtrTy = builder->getInt8PtrTy();
     17        write = cast<Function>(mod->getOrInsertFunction("write",
     18                                 AttributeSet().addAttribute(mod->getContext(), 2U, Attribute::NoAlias),
     19                                 sizeTy, int32Ty, int8PtrTy, sizeTy, nullptr));
    1920    }
    2021    return write;
     
    4041    auto savePoint = iBuilder->saveIP();
    4142    Module * m = iBuilder->getModule();
    42     Function * writefn = create_write(m);
     43    Function * writefn = create_write(m, iBuilder);
    4344    Function * doSegmentFunction = m->getFunction(mKernelName + doSegment_suffix);
    4445    Type * i8PtrTy = iBuilder->getInt8PtrTy();
     
    106107    auto savePoint = iBuilder->saveIP();
    107108    Module * m = iBuilder->getModule();
    108     Function * writefn = create_write(m);
     109    Function * writefn = create_write(m, iBuilder);
    109110    Function * finalBlockFunction = m->getFunction(mKernelName + finalBlock_suffix);
    110111    Type * i8PtrTy = iBuilder->getInt8PtrTy();
Note: See TracChangeset for help on using the changeset viewer.