Changeset 5634


Ignore:
Timestamp:
Sep 11, 2017, 2:35:55 PM (11 days ago)
Author:
nmedfort
Message:

Bug fix for last check in and for UnicodeSet::insert_range.

Location:
icGREP/icgrep-devel/icgrep
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/unicode_set.cpp

    r5632 r5634  
    489489    }
    490490
    491     //this->dump(llvm::errs()); llvm::errs() << " + [" << lo << ',' << hi << "]\n"; llvm::errs().flush();
    492 
    493491    // Create a temporary run and quad set for the given range
    494492    std::vector<run_t> runs;
     
    501499    auto qi = mQuads.cbegin();
    502500
    503     length_t length = 0;
     501    codepoint_t length = 0;
    504502    run_type_t type = Empty;
    505503
    506     // Advance past any full runs prior to the lo_index
     504    // Advance past any runs prior to the lo_index
    507505    for (;;) {
    508506        assert (ri != mRuns.cend());
    509         std::tie(type, length) = *ri;
    510         //llvm::errs() << std::distance(mRuns.cbegin(), ri) << ") type=" << (int)(type) << ", length=" << length << ", lo_index=" << lo_index << ", hi_index=" << hi_index << "\n"; llvm::errs().flush();
     507        std::tie(type, length) = *ri;       
    511508        if (lo_index < length) {
    512509            break;
     
    521518    }
    522519
    523     //llvm::errs() << "* " << std::distance(mRuns.cbegin(), ri) << ") type=" << (int)(type) << ", length=" << length << ", lo_index=" << lo_index << ", hi_index=" << hi_index << "\n"; llvm::errs().flush();
    524 
    525520    // Now record the runs and any quads prior to lo_index
    526521    runs.assign(mRuns.cbegin(), ri++);
    527522    if (lo_index) {
    528         runs.push_back(std::make_pair(type, lo_index));
     523        runs.emplace_back(type, lo_index);
    529524        if (type == Mixed) {
    530525            assert (static_cast<codepoint_t>(std::distance(qi, mQuads.cend())) >= lo_index);
     
    554549    }
    555550    --length;
    556 
    557     //llvm::errs() << "* " << std::distance(mRuns.cbegin(), ri) << ") type=" << (int)(type) << ", length=" << length << ", lo_index=" << lo_index << ", hi_index=" << hi_index << "\n"; llvm::errs().flush();
    558551
    559552    // Now check if we need to write out any Full blocks between the lo and hi code points; adjust our position
     
    569562            }
    570563            std::tie(type, length) = *ri++;
    571             //llvm::errs() << std::distance(mRuns.cbegin(), ri) << ") type=" << (int)(type) << ", length=" << length << ", lo_index=" << lo_index << ", hi_index=" << hi_index << "\n"; llvm::errs().flush();
    572564            if (hi_index < length) {
    573565                break;
    574566            }
    575567            hi_index -= length;
    576         }
    577 
     568            length = 0;
     569        }       
    578570        // Write out the hi_quad value
    579571        if (LLVM_UNLIKELY(type == Full)) {
     
    589581    }
    590582
    591     //llvm::errs() << "* " << std::distance(mRuns.cbegin(), ri) << ") type=" << (int)(type) << ", length=" << length << ", lo_index=" << lo_index << ", hi_index=" << hi_index << "\n";
    592 
    593     //llvm::errs() << "* remaining=" << std::distance(ri, mRuns.cend()) << "\n";
    594 
    595     //llvm::errs().flush();
    596 
    597583    // And append any remaining values from the original data
     584    assert (length >= hi_index);
    598585    append_run(type, length - hi_index, runs);
    599586    assert ("We wrote all the runs but still have remaining quads?" && (ri != mRuns.cend() || qi == mQuads.cend()));
     
    601588    quads.insert(quads.end(), qi, mQuads.cend());
    602589    assert (verify(runs, quads));
    603 
    604590    mRuns.assign(runs.cbegin(), runs.cend());
    605     mQuads.assign(quads.cbegin(), quads.cend());
     591    mQuads.assign(quads.cbegin(), quads.cend());   
    606592}
    607593
  • icGREP/icgrep-devel/icgrep/kernels/source_kernel.cpp

    r5633 r5634  
    345345
    346346void MemorySourceKernel::generateInitializeMethod(const std::unique_ptr<KernelBuilder> & kb) {
    347     kb->setBaseAddress("sourceBuffer", kb->CreatePointerCast(kb->getScalarField("fileSource"), kb->getInt8Ty()));
     347    kb->setBaseAddress("sourceBuffer", kb->CreatePointerCast(kb->getScalarField("fileSource"), kb->getVoidPtrTy()));
    348348    kb->setBufferedSize("sourceBuffer", kb->getScalarField("fileSize"));
    349349    kb->setCapacity("sourceBuffer", kb->getScalarField("fileSize"));
  • icGREP/icgrep-devel/icgrep/re/re_name.h

    r5630 r5634  
    9898
    9999inline void Name::setDefinition(RE * definition) {
     100    assert (definition != nullptr);
    100101    assert (definition != this);
    101102    mDefinition = definition;
Note: See TracChangeset for help on using the changeset viewer.