Lines Matching refs:Stats
1 //===-- Statistic.cpp - Easy way to expose stats information --------------===//
12 // printed at the end of a run, when the -stats command line option is enabled
38 /// -stats - Command line option to cause transformations to emit stats about
42 Enabled("stats", cl::desc("Enable statistics output from program"));
50 std::vector<const Statistic*> Stats;
57 Stats.push_back(S);
68 // If stats are enabled, inform StatInfo that this statistic should be
109 StatisticInfo &Stats = *StatInfo;
113 for (size_t i = 0, e = Stats.Stats.size(); i != e; ++i) {
115 (unsigned)utostr(Stats.Stats[i]->getValue()).size());
117 (unsigned)std::strlen(Stats.Stats[i]->getName()));
121 std::stable_sort(Stats.Stats.begin(), Stats.Stats.end(), NameCompare());
129 for (size_t i = 0, e = Stats.Stats.size(); i != e; ++i) {
130 std::string CountStr = utostr(Stats.Stats[i]->getValue());
132 << CountStr << " " << Stats.Stats[i]->getName()
133 << std::string(MaxNameLen-std::strlen(Stats.Stats[i]->getName()), ' ')
134 << " - " << Stats.Stats[i]->getDesc() << "\n";
143 StatisticInfo &Stats = *StatInfo;
146 if (Stats.Stats.empty()) return;