mirror of
https://github.com/rui314/mold.git
synced 2024-11-14 07:18:42 +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";
|
|
}
|