Changeset 4343 for icGREP


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

Eliminate superfluous return values for compileStatement(s)

Location:
icGREP/icgrep-devel/icgrep
Files:
3 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
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.h

    r4301 r4343  
    7373    void SetOutputValue(Value * marker, const unsigned index);
    7474
    75     Value* compileStatements(const StatementList & stmts);
    76     Value* compileStatement(const PabloAST * stmt);
     75    void compileStatements(const StatementList & stmts);
     76    void compileStatement(const PabloAST * stmt);
    7777    Value* compileExpression(const PabloAST * expr);
    7878    Value* genCarryInLoad(const unsigned index);
  • icGREP/icgrep-devel/icgrep/re/re_parser.cpp

    r4333 r4343  
    233233                }
    234234                throw_incomplete_expression_error_if_end_of_stream();
    235                 std::cerr << "New fModeFlagSet " << fModeFlagSet << " ignored.\n";
    236235                if (*_cursor == ':') {
    237236                    ++_cursor;
Note: See TracChangeset for help on using the changeset viewer.