Ignore:
Timestamp:
Dec 17, 2014, 12:34:42 PM (5 years ago)
Author:
cameron
Message:

Eliminate superfluous return values for compileStatement(s)

File:
1 edited

Legend:

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

    r4301 r4343  
    579579}
    580580
    581 Value * PabloCompiler::compileStatements(const StatementList & stmts) {
     581void PabloCompiler::compileStatements(const StatementList & stmts) {
    582582    Value * retVal = nullptr;
    583583    for (const PabloAST * statement : stmts) {
    584         retVal = compileStatement(statement);
    585     }
    586     return retVal;
    587 }
    588 
    589 Value * PabloCompiler::compileStatement(const PabloAST * stmt)
     584        compileStatement(statement);
     585    }
     586}
     587
     588void PabloCompiler::compileStatement(const PabloAST * stmt)
    590589{
    591     Value * retVal = nullptr;
    592590    if (const Assign * assign = dyn_cast<const Assign>(stmt))
    593591    {
     
    597595            SetOutputValue(expr, assign->getOutputIndex());
    598596        }
    599         retVal = expr;
    600597    }
    601598    if (const Next * next = dyn_cast<const Next>(stmt))
     
    603600        Value* expr = compileExpression(next->getExpr());
    604601        mMarkerMap[next->getName()] = expr;
    605         retVal = expr;
    606602    }
    607603    else if (const If * ifstmt = dyn_cast<const If>(stmt))
     
    624620        ++mNestingDepth;
    625621
    626         Value *  returnMarker = compileStatements(ifstmt->getBody());
     622        compileStatements(ifstmt->getBody());
    627623
    628624        int if_end_idx = mCarryQueueIdx;
     
    676672        mBasicBlock = ifEndBlock;
    677673        --mNestingDepth;
    678 
    679         retVal = returnMarker;
    680674    }
    681675    else if (const While * whileStatement = dyn_cast<const While>(stmt))
     
    757751        // BODY BLOCK
    758752        mBasicBlock = whileBodyBlock;
    759         retVal = compileStatements(whileStatement->getBody());
     753        compileStatements(whileStatement->getBody());
    760754        // update phi nodes for any carry propogating instruction
    761755        IRBuilder<> bWhileBody(mBasicBlock);
     
    794788        }
    795789    }
    796     return retVal;
    797790}
    798791
Note: See TracChangeset for help on using the changeset viewer.