Example #1
0
bool PassClean::execute(Program &ssa)
{
    doLog(LOG_INFO, "----------------------\n");
    doLog(LOG_INFO, "  Running Clean pass\n");
    doLog(LOG_INFO, "----------------------\n");

    PassClean pass(ssa);

    // remove re-interpreted nodes
    for(auto statement : ssa.m_statements)
    {
        if (!statement->accept(&pass))
        {
            return false;
        }
    }

    ssa.applyPatches();
    //Note: we should not call updateOutputPrecision
    //      here as the removed reinterpret nodes
    //      will cause erronous results.
    //ssa.updateOutputPrecisions();
    return true;
}