1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-22 18:40:59 +03:00
mold/perf.cc

19 lines
423 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;
std::sort(vec.begin(), vec.end(),
2020-11-03 11:54:02 +03:00
[](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
}