mirror of
https://github.com/rui314/mold.git
synced 2024-12-27 10:23:41 +03:00
19 lines
423 B
C++
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";
|
|
}
|