Ignore:
Timestamp:
Jul 16, 2015, 1:51:51 PM (4 years ago)
Author:
nmedfort
Message:

Added pablo Prototype to compiler. All Calls must be given one instead of a Name.

File:
1 edited

Legend:

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

    r4679 r4680  
    166166
    167167    //The basis bits structure
    168     for (unsigned i = 0; i != function.getParameters().size(); ++i) {
     168    for (unsigned i = 0; i != function.getNumOfParameters(); ++i) {
    169169        Value* indices[] = {mBuilder->getInt64(0), mBuilder->getInt32(i)};
    170170        Value * gep = mBuilder->CreateGEP(mInputAddressPtr, indices);
     
    188188   
    189189    // Write the output values out
    190     for (unsigned i = 0; i != function.getResults().size(); ++i) {
     190    for (unsigned i = 0; i != function.getNumOfResults(); ++i) {
     191        assert (function.getResult(i));
    191192        SetOutputValue(mMarkerMap[function.getResult(i)], i);
    192193    }
     
    205206
    206207inline void PabloCompiler::GenerateFunction(PabloFunction & function) {
    207     mInputType = PointerType::get(StructType::get(mMod->getContext(), std::vector<Type *>(function.getParameters().size(), mBitBlockType)), 0);
     208    mInputType = PointerType::get(StructType::get(mMod->getContext(), std::vector<Type *>(function.getNumOfParameters(), mBitBlockType)), 0);
    208209    Type * carryType = PointerType::get(mBitBlockType, 0);
    209     Type * outputType = PointerType::get(StructType::get(mMod->getContext(), std::vector<Type *>(function.getResults().size(), mBitBlockType)), 0);
     210    Type * outputType = PointerType::get(StructType::get(mMod->getContext(), std::vector<Type *>(function.getNumOfResults(), mBitBlockType)), 0);
    210211    FunctionType * functionType = FunctionType::get(Type::getVoidTy(mMod->getContext()), {{mInputType, carryType, outputType}}, false);
    211212
     
    793794   
    794795void PabloCompiler::SetOutputValue(Value * marker, const unsigned index) {
     796    assert (marker);
    795797    if (marker->getType()->isPointerTy()) {
    796798        marker = mBuilder->CreateAlignedLoad(marker, BLOCK_SIZE/8, false);
Note: See TracChangeset for help on using the changeset viewer.