Ignore:
Timestamp:
Nov 11, 2017, 9:46:13 PM (15 months ago)
Author:
cameron
Message:

Changes for compatibility with LLVM 5.0.0

File:
1 edited

Legend:

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

    r5721 r5733  
    6060    }
    6161    StructType * const sharedStructType = StructType::get(m->getContext(), structTypes);
    62     StructType * const threadStructType = StructType::get(sharedStructType->getPointerTo(), sizeTy, nullptr);
     62    StructType * const threadStructType = StructType::get(m->getContext(), {sharedStructType->getPointerTo(), sizeTy});
    6363
    6464    Function * const threadFunc = makeThreadFunction(iBuilder, "segment");
     65    Function::arg_iterator args = threadFunc->arg_begin();
     66    Value * threadStruct = iBuilder->CreateBitCast(&*(args), threadStructType->getPointerTo());
    6567
    6668    // -------------------------------------------------------------------------------------------------------------------------
     
    7274    BasicBlock * entryBlock = BasicBlock::Create(iBuilder->getContext(), "entry", threadFunc);
    7375    iBuilder->SetInsertPoint(entryBlock);
    74     Value * const input = &threadFunc->getArgumentList().front();
    75     Value * const threadStruct = iBuilder->CreatePointerCast(input, threadStructType->getPointerTo());
    7676    Value * const sharedStatePtr = iBuilder->CreateLoad(iBuilder->CreateGEP(threadStruct, {iBuilder->getInt32(0), iBuilder->getInt32(0)}));
    7777    for (unsigned k = 0; k < n; ++k) {
     
    383383
    384384        Function * const threadFunc = makeThreadFunction(iBuilder, "ppt:" + kernel->getName());
    385 
     385        Function::arg_iterator ai = threadFunc->arg_begin();
     386        Value * sharedStruct = iBuilder->CreateBitCast(&*(ai), sharedStructType->getPointerTo());
     387       
    386388         // Create the basic blocks for the thread function.
    387389        BasicBlock * entryBlock = BasicBlock::Create(iBuilder->getContext(), "entry", threadFunc);
     
    393395        iBuilder->SetInsertPoint(entryBlock);
    394396
    395         Value * sharedStruct = iBuilder->CreateBitCast(&threadFunc->getArgumentList().front(), sharedStructType->getPointerTo());
    396397
    397398        for (unsigned k = 0; k < n; k++) {
Note: See TracChangeset for help on using the changeset viewer.