mirror of
https://github.com/rui314/mold.git
synced 2024-12-27 10:23:41 +03:00
wip
This commit is contained in:
parent
b1f5b4f9b7
commit
7dbfb01b10
@ -115,7 +115,7 @@ static void mark(tbb::concurrent_vector<InputSection *> roots) {
|
||||
|
||||
// Remove unreachable sections
|
||||
static void sweep() {
|
||||
Timer t3("sweep");
|
||||
Timer t("sweep");
|
||||
static Counter counter("garbage_sections");
|
||||
|
||||
tbb::parallel_for_each(out::objs, [&](ObjectFile *file) {
|
||||
|
3
main.cc
3
main.cc
@ -889,6 +889,9 @@ int main(int argc, char **argv) {
|
||||
on_complete = fork_child();
|
||||
}
|
||||
|
||||
if (config.print_stats)
|
||||
Counter::enabled = true;
|
||||
|
||||
for (std::string_view arg : config.trace_symbol)
|
||||
Symbol::intern(arg)->traced = true;
|
||||
|
||||
|
8
mold.h
8
mold.h
@ -1102,17 +1102,21 @@ public:
|
||||
}
|
||||
|
||||
Counter &operator++(int) {
|
||||
values.local()++;
|
||||
if (enabled)
|
||||
values.local()++;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Counter &operator+=(int delta) {
|
||||
values.local() += delta;
|
||||
if (enabled)
|
||||
values.local() += delta;
|
||||
return *this;
|
||||
}
|
||||
|
||||
static void print();
|
||||
|
||||
static inline bool enabled = false;
|
||||
|
||||
private:
|
||||
i64 get_value();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user