[all-commits] [llvm/llvm-project] d7a09f: [ADT][NFC] Simplify llvm::unique_function (#208251)

Alexis Engelke via All-commits all-commits at lists.llvm.org
Wed Jul 8 11:01:36 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d7a09fb4ac7a3f231f1e4be7c00ef8c47e12d76b
      https://github.com/llvm/llvm-project/commit/d7a09fb4ac7a3f231f1e4be7c00ef8c47e12d76b
  Author: Alexis Engelke <engelke at in.tum.de>
  Date:   2026-07-08 (Wed, 08 Jul 2026)

  Changed paths:
    M llvm/include/llvm/ADT/FunctionExtras.h

  Log Message:
  -----------
  [ADT][NFC] Simplify llvm::unique_function (#208251)

Refactor the core of UniqueFunctionBase to move away from static
function pointer tables, which consume ~4kiB in .data.rel.ro. Instead,
store two function pointers on construction of the UniqueFunctionBase,
one for call and one that combines move and destruction. Retain the
memcpy path for trivial inline structs. (I haven't verified whether this
is actually beneficial.)

Also, greatly simplify the class and implement the callbacks using
lambdas.



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