llvm.org GIT mirror llvm / aeac00e
Including statistics into an anonymous namespace that gets #included into every file is a bad idea. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7489 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
2 changed file(s) with 2 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
1515 #define SUPPORT_TARJANSCCITERATOR_H
1616
1717 #include "Support/GraphTraits.h"
18 #include "Support/Statistic.h"
18 #include "Support/Debug.h"
1919 #include "Support/iterator"
2020 #include
2121 #include
5454 // class TarjanSCC_iterator: Enumerate the SCCs of a directed graph, in
5555 // reverse topological order of the SCC DAG.
5656 //--------------------------------------------------------------------------
57
58 namespace {
59 Statistic<> NumSCCs("NumSCCs", "Number of Strongly Connected Components");
60 Statistic<> MaxSCCSize("MaxSCCSize", "Size of largest Strongly Connected Component");
61 }
6257
6358 template >
6459 class TarjanSCC_iterator : public forward_iterator, ptrdiff_t>
151146 SCCNodeStack.pop();
152147 nodeVisitNumbers[CurrentSCC.back()] = ~0UL;
153148 } while (CurrentSCC.back() != visitingN);
154
155 ++NumSCCs;
156 if (CurrentSCC.size() > MaxSCCSize) MaxSCCSize = CurrentSCC.size();
157
158149 return;
159150 }
160151 }
1515 #define SUPPORT_TARJANSCCITERATOR_H
1616
1717 #include "Support/GraphTraits.h"
18 #include "Support/Statistic.h"
18 #include "Support/Debug.h"
1919 #include "Support/iterator"
2020 #include
2121 #include
5454 // class TarjanSCC_iterator: Enumerate the SCCs of a directed graph, in
5555 // reverse topological order of the SCC DAG.
5656 //--------------------------------------------------------------------------
57
58 namespace {
59 Statistic<> NumSCCs("NumSCCs", "Number of Strongly Connected Components");
60 Statistic<> MaxSCCSize("MaxSCCSize", "Size of largest Strongly Connected Component");
61 }
6257
6358 template >
6459 class TarjanSCC_iterator : public forward_iterator, ptrdiff_t>
151146 SCCNodeStack.pop();
152147 nodeVisitNumbers[CurrentSCC.back()] = ~0UL;
153148 } while (CurrentSCC.back() != visitingN);
154
155 ++NumSCCs;
156 if (CurrentSCC.size() > MaxSCCSize) MaxSCCSize = CurrentSCC.size();
157
158149 return;
159150 }
160151 }