示例#1
0
// Special intersection method: this := a intersect b
void StatementList::makeIsect(StatementList& a, LocationSet& b)
{
    slist.clear();
    for (iterator it = a.slist.begin(); it != a.slist.end(); ++it)
        {
            Assignment* as = (Assignment*)*it;
            if (b.exists(as->getLeft()))
                slist.push_back(as);
        }
}
示例#2
0
Statement *StatementList::removeFirstDefOf(SharedExp loc)
{
    if (!loc) {
        return nullptr;
    }

    for (iterator it = begin(); it != end(); ++it) {
        assert((*it)->isAssignment());
        Assignment *assign = static_cast<Assignment *>(*it);

        if (*assign->getLeft() == *loc) {
            erase(it);
            return assign;
        }
    }

    return nullptr;
}