Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures
authorAmy Huang <akhuang@google.com>
Thu, 16 Sep 2021 23:48:26 +0000 (16:48 -0700)
committerAmy Huang <akhuang@google.com>
Sat, 18 Sep 2021 00:18:42 +0000 (17:18 -0700)
commit6f7483b1ece4747f2aafe4baa05fc07e7dc9ed9d
tree571736054b8234733f046655d970b2f1d1dd6332
parent27905eeb89620357bbb69e8396c4708341a5fd1a
Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures

Original commit description:

  [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

This reverts commit a2fd05ada9030eab2258fff25e77a05adccae128.

Original commits were b4fa71eed34d967195514fe9b0a5211fca2bc5bc
and e03c7e367adb8f228332e3c2ef8f45484597b719.
38 files changed:
lld/COFF/CMakeLists.txt
lld/COFF/COFFLinkerContext.cpp [new file with mode: 0644]
lld/COFF/COFFLinkerContext.h [new file with mode: 0644]
lld/COFF/CallGraphSort.cpp
lld/COFF/CallGraphSort.h
lld/COFF/Chunks.cpp
lld/COFF/Chunks.h
lld/COFF/DLL.cpp
lld/COFF/DLL.h
lld/COFF/DebugTypes.cpp
lld/COFF/DebugTypes.h
lld/COFF/Driver.cpp
lld/COFF/Driver.h
lld/COFF/ICF.cpp
lld/COFF/ICF.h
lld/COFF/InputFiles.cpp
lld/COFF/InputFiles.h
lld/COFF/LLDMapFile.cpp
lld/COFF/LLDMapFile.h
lld/COFF/LTO.cpp
lld/COFF/LTO.h
lld/COFF/MapFile.cpp
lld/COFF/MapFile.h
lld/COFF/MarkLive.cpp
lld/COFF/MarkLive.h
lld/COFF/MinGW.cpp
lld/COFF/MinGW.h
lld/COFF/PDB.cpp
lld/COFF/PDB.h
lld/COFF/SymbolTable.cpp
lld/COFF/SymbolTable.h
lld/COFF/TypeMerger.h
lld/COFF/Writer.cpp
lld/COFF/Writer.h
lld/Common/Timer.cpp
lld/include/lld/Common/Timer.h
lld/test/COFF/timers.ll [new file with mode: 0644]
llvm/utils/gn/secondary/lld/COFF/BUILD.gn