Changeset 5081


Ignore:
Timestamp:
Jul 5, 2016, 9:10:16 PM (3 years ago)
Author:
cameron
Message:

Some changes recommended by cppcheck

Location:
icGREP/icgrep-devel/icgrep
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/ucd_compiler.cpp

    r5046 r5081  
    199199
    200200            // If this range is empty, just skip creating the if block
    201             if (targets.size() > 0) {
     201            if (!targets.empty()) {
    202202                builder.createIf(ifTestCompiler(range.first, range.second, builder), std::move(targets), inner_block);
    203203                for (const auto ti : intersectingTargets) {
  • icGREP/icgrep-devel/icgrep/pablo/builder.cpp

    r5061 r5081  
    88        return mPb->NAME(arg); \
    99    } \
    10     inline PabloAST * operator()(PabloAST * arg, const std::string name) { \
     10    inline PabloAST * operator()(PabloAST * arg, const std::string & name) { \
    1111        return mPb->NAME(arg, name); \
    1212    } \
     
    2323        return mPb->NAME(arg1, arg2); \
    2424    } \
    25     inline PabloAST * operator()(PabloAST * arg1, PabloAST * arg2, const std::string name) { \
     25    inline PabloAST * operator()(PabloAST * arg1, PabloAST * arg2, const std::string & name) { \
    2626        return mPb->NAME(arg1, arg2, name); \
    2727    } \
     
    3939        return mPb->NAME(arg1, arg2, arg3); \
    4040    } \
    41     inline PabloAST * operator()(PabloAST * arg1, PabloAST * arg2, PabloAST * arg3, const std::string name) { \
     41    inline PabloAST * operator()(PabloAST * arg1, PabloAST * arg2, PabloAST * arg3, const std::string & name) { \
    4242        return mPb->NAME(arg1, arg2, arg3, name); \
    4343    } \
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/distributivepass.cpp

    r4927 r5081  
    386386    std::vector<Variadic *> Q = {var};
    387387
    388     while (Q.size() > 0) {
     388    while (!Q.empty() {
    389389        Variadic * expr = CanonicalizeDFG::canonicalize(Q.back()); Q.pop_back();
    390390        PabloAST * const replacement = Simplifier::fold(expr, expr->getParent());
  • icGREP/icgrep-devel/icgrep/pablo/passes/flattenassociativedfg.cpp

    r4922 r5081  
    575575        }
    576576    }
    577     while (Q.size() > 0) {
     577    while (!Q.empty()) {
    578578        const auto u = Q.front(); Q.pop();
    579579        visited[u] = true;
  • icGREP/icgrep-devel/icgrep/pablo/symbol_generator.cpp

    r4860 r5081  
    4343String * SymbolGenerator::make(const std::string prefix, const bool generated) {
    4444    auto f = mPrefixMap.find(prefix);
    45     unsigned count = 0;
    4645    if (f == mPrefixMap.end()) {
    4746        mPrefixMap.insert(std::make_pair(prefix, 1));
    4847        return get(prefix, generated);
    4948    } else {
    50         count = f->second++;
     49        unsigned count = f->second++;
    5150        return get(prefix + std::to_string(count), generated);
    5251    }
Note: See TracChangeset for help on using the changeset viewer.