1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-22 10:27:48 +03:00
mold/perf.cc

20 lines
425 B
C++
Raw Normal View History

2020-11-03 11:26:42 +03:00
#include "mold.h"
using namespace llvm;
std::vector<Counter *> Counter::instances;
bool Counter::enabled = true;
void Counter::print() {
if (!enabled)
return;
std::vector<Counter *> vec = instances;
2020-11-30 12:43:04 +03:00
std::stable_sort(vec.begin(), vec.end(), [](Counter *a, Counter *b) {
return a->value > b->value;
});
2020-11-03 11:26:42 +03:00
for (Counter *c : vec)
2020-11-03 11:36:43 +03:00
llvm::outs() << right_justify(c->name, 20) << "=" << c->value << "\n";
2020-11-03 11:26:42 +03:00
}