1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-11 16:58:12 +03:00
mold/perf.cc
2020-11-03 17:54:02 +09:00

19 lines
423 B
C++

#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(),
[](Counter *a, Counter *b) { return a->value > b->value; });
for (Counter *c : vec)
llvm::outs() << right_justify(c->name, 20) << "=" << c->value << "\n";
}