Ignore:
Timestamp:
Mar 5, 2019, 6:17:55 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
b830e046, c101756
Parents:
34737de (diff), 972540e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/Stats/Counter.cc

    r34737de rb38433b  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Heap.h --
     7// Counter.cc --
    88//
    99// Author           : Thierry Delisle
     
    1818#include <algorithm>
    1919#include <cstring>
     20#include <functional>
    2021#include <iomanip>
    2122
    2223namespace Stats {
    2324        namespace Counters {
    24 
    25                 template<typename T>
    26                 void ForAllCounters(BaseCounter::list_t & range, size_t level, T func) {
    27                         auto it = range.head;
    28                         while(it) {
    29                                 auto next = it->next;
    30                                 func(it, level);
    31                                 ForAllCounters(it->children, level + 1, func);
    32                                 it = next;
    33                         }
    34                 }
    35 
    3625                void print() {
    37                         if(!BaseCounter::top.head) return;
     26                        if(!top.head) return;
    3827                        size_t nc = 0;
    39                         ForAllCounters(BaseCounter::top, 0, [&](BaseCounter * node, size_t level) {
     28                        Base::ForAll(top, 0, [&](Base::TreeImpl * node, size_t level) {
    4029                                nc = std::max(nc, (4 * level) + std::strlen(node->name));
    4130                        });
     
    4938
    5039
    51                         ForAllCounters(BaseCounter::top, 0, [&](BaseCounter * node, size_t level) {
     40                        Base::ForAll(top, 0, [&](Base::TreeImpl * node, size_t level) {
    5241                                std::cerr << std::string(level * 4, ' ');
    5342                                std::cerr << node->name;
     
    5847                                std::cerr << " |";
    5948                                std::cerr << '\n';
    60                                 delete node;
    61                         });
     49                        }, true);
    6250
    6351                        std::cerr << std::string(nct, '-') << std::endl;
    6452                }
    6553
    66                 BaseCounter::list_t BaseCounter::top;
     54                Base::TreeTop top;
     55
     56                extern bool enabled;
    6757        }
    6858}
Note: See TracChangeset for help on using the changeset viewer.