Esempio n. 1
0
void SLintVisitor::visit(const ast::ForExp & e)
{
    context.pushLoop(&e);
    auto range = preCheck(e);
    e.getVardec().accept(*this);
    e.getBody().accept(*this);
    postCheck(e, range);
    context.popLoop();
}
void AnalysisVisitor::visit(ast::ForExp & e)
{
    logger.log(L"ForExp", e.getLocation());
    loops.push(&e);

    dm.addBlock(Block::LOOP, &e);
    e.getVardec().accept(*this);
    dm.addBlock(Block::NORMAL, &e.getBody());
    e.getBody().accept(*this);

    if (dm.requiresAnotherTrip())
    {
        dm.finalizeBlock();
        dm.addBlock(Block::NORMAL, &e.getBody());
        e.getBody().accept(*this);

        if (dm.requiresAnotherTrip())
        {
            std::wcerr << "Invalid forexp: types or refcount are not the same before and after the loop" << std::endl;
        }
    }

    dm.finalizeBlock();
    dm.finalizeBlock();

    loops.pop();
}
void InstrumentVisitor::visit(ast::ForExp & e)
{
    ++branchesCount;
    e.getBody().accept(*this);
}
Esempio n. 4
0
 void GlobalsCollector::visit(ast::ForExp & e)
 {
     e.getVardec().accept(*this);
     e.getBody().accept(*this);
 }