Ignore:
Timestamp:
Mar 7, 2016, 3:37:30 PM (4 years ago)
Author:
nmedfort
Message:

Initial modifications to Pablo Compiler and Kernel Builder to support circular buffers for Lookahead.

File:
1 edited

Legend:

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

    r4919 r4959  
    218218 * @brief verifyProgramStructure
    219219 ** ------------------------------------------------------------------------------------------------------------- */
    220 void verifyProgramStructure(const PabloBlock * block) {
     220void verifyProgramStructure(const PabloBlock * block, unsigned & nestingDepth) {
    221221    const Statement * prev = nullptr;
    222222    for (const Statement * stmt : *block) {
     
    279279                }
    280280            }
    281             verifyProgramStructure(nested);
    282         }
    283     }
     281            ++nestingDepth;
     282            verifyProgramStructure(nested, nestingDepth);
     283            --nestingDepth;
     284        }
     285    }   
    284286}
    285287
    286288inline void verifyProgramStructure(const PabloFunction & function) {
    287     verifyProgramStructure(function.getEntryBlock());
     289    unsigned nestingDepth = 0;
     290    verifyProgramStructure(function.getEntryBlock(), nestingDepth);
     291    if (LLVM_UNLIKELY(nestingDepth != 0)) {
     292        // This error isn't actually possible to occur with the current AST structure but that could change
     293        // in the future. Leaving this test in for a reminder to check for it.
     294        throw std::runtime_error("PabloVerifier: unbalanced If or While nesting depth.");
     295    }
    288296}
    289297
Note: See TracChangeset for help on using the changeset viewer.