[PATCH] D109634: [LLD] Remove global state in lld/COFF

Amy Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 15:04:31 PDT 2021


akhuang created this revision.
akhuang added reviewers: amccarth, aganea, MaskRay.
Herald added subscribers: ormris, mstorsjo, steven_wu, hiraditya, mgorny.
akhuang requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109634

Files:
  lld/COFF/CMakeLists.txt
  lld/COFF/COFFLinkerContext.cpp
  lld/COFF/COFFLinkerContext.h
  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/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
  llvm/utils/gn/secondary/lld/COFF/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109634.372018.patch
Type: text/x-patch
Size: 122708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210910/3c753c69/attachment.bin>


More information about the llvm-commits mailing list