Ignore:
Timestamp:
Feb 3, 2017, 2:31:24 PM (3 years ago)
Author:
nmedfort
Message:

Removed StreamType? in favour of 0-length VectorType?.

File:
1 edited

Legend:

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

    r5297 r5298  
    2020using namespace llvm;
    2121
     22inline bool isStreamType(const Type * ty) {
     23    if (ty->isArrayTy()) {
     24        ty = ty->getArrayElementType();
     25    }
     26    if (ty->isVectorTy()) {
     27        return (ty->getVectorNumElements() == 0);
     28    }
     29    return false;
     30}
     31
    2232Var * PabloKernel::addInput(const std::string & name, Type * const type) {
    2333    Var * param = new (mAllocator) Var(mSymbolTable->makeString(name, iBuilder), type, mAllocator, Var::ReadOnly);
     
    2535    mInputs.push_back(param);
    2636    mVariables.push_back(param);
    27     if (isa<ArrayType>(type) || isa<StreamType>(type)) {
     37    if (isStreamType(type)) {
    2838        mStreamSetInputs.emplace_back(type, name);
    2939    } else {
     
    3949    mOutputs.push_back(result);
    4050    mVariables.push_back(result);
    41     if (isa<ArrayType>(type) || isa<StreamType>(type)) {
     51    if (isStreamType(type)) {
    4252        mStreamSetOutputs.emplace_back(type, name);
    4353    } else {
Note: See TracChangeset for help on using the changeset viewer.