[all-commits] [llvm/llvm-project] c86292: [llc] Add a reusable LLVMLlcDriver library (#221896)

Anutosh Bhat via All-commits all-commits at lists.llvm.org
Thu Sep 10 03:27:24 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c86292488b86080d994de4164342b8e0fdd43543
      https://github.com/llvm/llvm-project/commit/c86292488b86080d994de4164342b8e0fdd43543
  Author: Anutosh Bhat <andersonbhat491 at gmail.com>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    M llvm/tools/llc/CMakeLists.txt
    M llvm/tools/llc/llc.cpp
    A llvm/tools/llc/llcdriver.cpp
    M utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

  Log Message:
  -----------
  [llc] Add a reusable LLVMLlcDriver library (#221896)

Please read :
[RFC](https://discourse.llvm.org/t/rfc-embeddable-llvm-tool-drivers-for-long-lived-hosts/91754)
and [RFC
section](https://discourse.llvm.org/t/rfc-embeddable-llvm-tool-drivers-for-long-lived-hosts/91754#p-367966-proposed-first-change-llvmllcdriver-8)

This splits `llc` into a small standalone executable and a reusable
`LLVMLlcDriver` library.

The change follows the structure introduced for `opt` by @wsmoses in
[#79205](https://github.com/llvm/llvm-project/pull/79205): the
command-line implementation moves into a driver library, while `llc.cpp`
remains the standalone entry point and continues to own `InitLLVM`.

The immediate motivation is embedding `llc` in long-lived applications
such as [WasmBolt](https://github.com/anutosh491/WasmBolt) (try
[here](https://anutosh21.github.io/WasmBolt/))

Currently, embedders must compile and modify a copy of `llc.cpp` because
the implementation and `main()` live in the same translation unit. This
split provides a reusable entry point without changing the behavior of
the
standalone `llc` executable.



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