[all-commits] [llvm/llvm-project] f860fe: [LLD] Remove global state in lldCommon

Alexandre Ganea via All-commits all-commits at lists.llvm.org
Sun Jan 16 05:58:12 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f860fe362282ed69b9d4503a20e5d20b9a041189
      https://github.com/llvm/llvm-project/commit/f860fe362282ed69b9d4503a20e5d20b9a041189
  Author: Alexandre Ganea <alexandre.ganea at legionlabs.com>
  Date:   2022-01-16 (Sun, 16 Jan 2022)

  Changed paths:
    M lld/COFF/COFFLinkerContext.h
    M lld/COFF/Chunks.cpp
    M lld/COFF/DLL.cpp
    M lld/COFF/Driver.cpp
    M lld/COFF/DriverUtils.cpp
    M lld/COFF/InputFiles.cpp
    M lld/COFF/LTO.cpp
    M lld/COFF/MinGW.cpp
    M lld/COFF/PDB.cpp
    M lld/COFF/SymbolTable.cpp
    M lld/COFF/Writer.cpp
    M lld/Common/CMakeLists.txt
    A lld/Common/CommonLinkerContext.cpp
    M lld/Common/ErrorHandler.cpp
    M lld/Common/Memory.cpp
    M lld/Common/TargetOptionsCommandFlags.cpp
    M lld/ELF/AArch64ErrataFix.cpp
    M lld/ELF/ARMErrataFix.cpp
    M lld/ELF/Arch/PPC64.cpp
    M lld/ELF/Driver.cpp
    M lld/ELF/DriverUtils.cpp
    M lld/ELF/InputFiles.cpp
    M lld/ELF/InputSection.cpp
    M lld/ELF/LinkerScript.cpp
    M lld/ELF/MarkLive.cpp
    M lld/ELF/ScriptParser.cpp
    M lld/ELF/SyntheticSections.cpp
    M lld/ELF/Thunks.cpp
    M lld/ELF/Writer.cpp
    M lld/MachO/ConcatOutputSection.cpp
    M lld/MachO/Driver.cpp
    M lld/MachO/DriverUtils.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/LTO.cpp
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/Writer.cpp
    M lld/MinGW/Driver.cpp
    A lld/include/lld/Common/CommonLinkerContext.h
    M lld/include/lld/Common/Driver.h
    M lld/include/lld/Common/ErrorHandler.h
    M lld/include/lld/Common/Memory.h
    M lld/include/lld/Core/LinkingContext.h
    M lld/tools/lld/lld.cpp
    M lld/wasm/Driver.cpp
    M lld/wasm/InputFiles.cpp
    M lld/wasm/SymbolTable.cpp
    M lld/wasm/Writer.cpp

  Log Message:
  -----------
  [LLD] Remove global state in lldCommon

Move all variables at file-scope or function-static-scope into a hosting structure (lld::CommonLinkerContext) that lives at lldMain()-scope. Drivers will inherit from this structure and add their own global state, in the same way as for the existing COFFLinkerContext.

See discussion in https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html

Differential Revision: https://reviews.llvm.org/D108850




More information about the All-commits mailing list