Ignore:
Timestamp:
Sep 18, 2015, 1:25:24 PM (4 years ago)
Author:
nmedfort
Message:

Work towards testing reassociation + multiplexing.

File:
1 edited

Legend:

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

    r4773 r4775  
    44#include <pablo/printer_pablos.h>
    55#include <iostream>
    6 #include <unordered_set>
     6#include <boost/container/flat_set.hpp>
    77
    88namespace pablo {
     
    2424private:
    2525    const OrderingVerifier * const mParent;
    26     std::unordered_set<const PabloAST *> mSet;
     26    boost::container::flat_set<const PabloAST *> mSet;
    2727};
    2828
    2929void isTopologicallyOrdered(const PabloBlock & block, const OrderingVerifier & parent, const bool ignoreUnusedStatements) {
    3030    OrderingVerifier ov(parent);
     31    const Statement * previousStatement = nullptr;
    3132    for (const Statement * stmt : block) {
     33        if (stmt->getPrevNode() != previousStatement) {
     34            // TODO: make this actually test whether the operand is ever defined,
     35            // or if it was defined in a scope that cannot be reached?
     36            std::string tmp;
     37            raw_string_ostream str(tmp);
     38            PabloPrinter::print(stmt, "PabloVerifier: ", str);
     39            str << " is not preceeded by the expected statement!";
     40            throw std::runtime_error(str.str());
     41        }
     42        previousStatement = stmt;
    3243        if (stmt->getNumUses() == 0 && ignoreUnusedStatements) {
    3344            continue;
     
    4859                str << "PabloVerifier: function is not topologically ordered! ";
    4960                PabloPrinter::print(stmt->getOperand(i), str);
    50                 str << " was used before definition!";
     61                PabloPrinter::print(stmt, " was used before definition by ", str);
    5162                throw std::runtime_error(str.str());
    5263            }
Note: See TracChangeset for help on using the changeset viewer.