diff options
author | Amy Huang <akhuang@google.com> | 2021-09-03 15:28:29 -0700 |
---|---|---|
committer | Amy Huang <akhuang@google.com> | 2021-09-16 11:00:23 -0700 |
commit | b4fa71eed34d967195514fe9b0a5211fca2bc5bc (patch) | |
tree | ef30abe580a577df7b2744a70097107433d9a101 /lld/include | |
parent | c96d45700f6d3cb2b8d1972bb8de03522b3ff8d7 (diff) | |
download | llvm-b4fa71eed34d967195514fe9b0a5211fca2bc5bc.tar.gz |
[LLD] Remove global state in lld/COFF
This patch removes globals from the lldCOFF library, by moving globals
into a context class (COFFLinkingContext) and passing it around wherever
it's needed.
See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html for
context about removing globals from LLD.
I also haven't moved the `driver` or `config` variables yet.
Differential Revision: https://reviews.llvm.org/D109634
Diffstat (limited to 'lld/include')
-rw-r--r-- | lld/include/lld/Common/Timer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/include/lld/Common/Timer.h b/lld/include/lld/Common/Timer.h index b37388cd38c4..7aca966f663c 100644 --- a/lld/include/lld/Common/Timer.h +++ b/lld/include/lld/Common/Timer.h @@ -38,7 +38,8 @@ class Timer { public: Timer(llvm::StringRef name, Timer &parent); - static Timer &root(); + // Creates the root timer. + explicit Timer(llvm::StringRef name); void addToTotal(std::chrono::nanoseconds time) { total += time.count(); } void print(); @@ -46,7 +47,6 @@ public: double millis() const; private: - explicit Timer(llvm::StringRef name); void print(int depth, double totalDuration, bool recurse = true) const; std::atomic<std::chrono::nanoseconds::rep> total; |