Ignore:
Timestamp:
Jan 16, 2018, 4:22:13 PM (21 months ago)
Author:
nmedfort
Message:

Added PabloBlock/Builder? createScope() methods + minor code changes.

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.cpp

    r5828 r5836  
    2323
    2424CC_Compiler::CC_Compiler(pablo::PabloKernel * kernel, pablo::Var * basisBits)
    25 : mBuilder(kernel->getEntryBlock())
     25: mBuilder(kernel->getEntryScope())
    2626, mEncodingBits(basisBits->getType()->getArrayNumElements())
    2727, mBasisBit(mEncodingBits) {
  • icGREP/icgrep-devel/icgrep/cc/multiplex_CCs.cpp

    r5816 r5836  
    123123        cc::doMultiplexCCs(CCs, mExclusiveSetIDs, mMultiplexedCCs);
    124124}
    125 
    126 const Alphabet * MultiplexedAlphabet::getSourceAlphabet() const {
    127     return mSourceAlphabet;
    128 }
    129 
    130 std::vector<std::vector<unsigned>> MultiplexedAlphabet::getExclusiveSetIDs() {
    131     return mExclusiveSetIDs;
    132 }
    133 
    134 std::vector<re::CC *> MultiplexedAlphabet::getMultiplexedCCs() {
    135     return mMultiplexedCCs;
    136 }
    137125   
    138126re::CC * MultiplexedAlphabet::transformCC(const re::CC * sourceCC) const {
    139     if (sourceCC->getAlphabet() != mSourceAlphabet) llvm::report_fatal_error("Mismatched source alphabets for transformCC");
    140    
    141     const auto index = find(mUnicodeSets.begin(), mUnicodeSets.end(), sourceCC) - mUnicodeSets.begin();
    142     if (index >= mUnicodeSets.size()) {
    143         llvm::errs() << Printer_RE::PrintRE(sourceCC) << " not found\n";
     127    if (sourceCC->getAlphabet() != mSourceAlphabet) {
     128        llvm::report_fatal_error("Mismatched source alphabets for transformCC");
    144129    }
     130    const auto f = find(mUnicodeSets.begin(), mUnicodeSets.end(), sourceCC);
     131    if (f == mUnicodeSets.end()) {
     132        llvm::report_fatal_error(Printer_RE::PrintRE(sourceCC) + " not found");
     133    }
     134    const auto index = f - mUnicodeSets.begin();
    145135    const auto exclusive_IDs = mExclusiveSetIDs[index];
    146136    re::CC * CC_union = re::makeCC(this);
  • icGREP/icgrep-devel/icgrep/cc/multiplex_CCs.h

    r5816 r5836  
    2323    const unsigned getSize() const override {return mUnicodeSets.size() + 1;}
    2424
    25     const Alphabet * getSourceAlphabet() const;
     25    const Alphabet * getSourceAlphabet() const {
     26        return mSourceAlphabet;
     27    }
    2628   
    27     std::vector<std::vector<unsigned>> getExclusiveSetIDs();
     29    const std::vector<std::vector<unsigned>> & getExclusiveSetIDs() const {
     30        return mExclusiveSetIDs;
     31    }
    2832   
    29     std::vector<re::CC *> getMultiplexedCCs();
     33    const std::vector<re::CC *> & getMultiplexedCCs() const {
     34        return mMultiplexedCCs;
     35    }
    3036   
    3137    re::CC * transformCC(const re::CC * sourceCC) const;
Note: See TracChangeset for help on using the changeset viewer.