[all-commits] [llvm/llvm-project] 73bb02: [ELF] Remove global ctx

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Nov 16 17:24:34 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73bb022b469a32eb5aee30f2947f3cea5e903caa
      https://github.com/llvm/llvm-project/commit/73bb022b469a32eb5aee30f2947f3cea5e903caa
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-11-16 (Sat, 16 Nov 2024)

  Changed paths:
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/SyntheticSections.cpp

  Log Message:
  -----------
  [ELF] Remove global ctx

This commit completes the work that eliminates global variables like
config/target/inputSections/symTab from lld/ELF.

Key changes:

* Introduced `lld::elf::ctx` to encapsulate global state.
* Moved global variables into `Ctx lld::elf::ctx`
* Updated many functions to accept `Ctx &ctx`
* Made `ctx` a local variable (this commit)

If we don't count `static std::mutex`, this is the last major global
state within lld/ELF (minor ones like `SharedFile::vernauxNum`
(33ff9e43b4c5bdc3da31c6b11ad51d35a69bec5f) might not all be eliminated
yet).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list