/// Construct based on a block explicit LocalInstrList(const std::vector<Block> &block_list) : cur(block_list.begin()), end(block_list.end()) { if (cur != end) { if (not cur->isInstr()) { increment(); // Get to the first instruction } } }
// Deference the iterator InstrPtr const &dereference() const { assert(cur != end); assert(cur->isInstr()); return cur->getInstr(); }
// Increase iterator void increment() { assert(cur != end); while(++cur != end and not cur->isInstr()) {} }