[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-31 Thread William Moses via cfe-commits
https://github.com/wsmoses updated https://github.com/llvm/llvm-project/pull/70171 >From bb04e157dcd667b9baf261f07f8081a52c5481a0 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Wed, 25 Oct 2023 02:10:32 -0500 Subject: [PATCH] [Clang] Add codegen option to add passbuilder callback

[llvm] [clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-31 Thread William Moses via cfe-commits
wsmoses wrote: Let me fork off the clang part off into a separate PR from the codegenoption. For context, I'm in an environment where I can't modify the LLVM build files (but I can import them), but want to produce the modified clang, without maintaining a separate fork just to add the pass.

[llvm] [clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-31 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The new option in CodeGenOptions.h seems fine. If your goal is to statically inject passes into the clang executable, I don't understand why the existing LLVM plugin infrastructure isn't sufficient for your needs. You mention "modifying Extension.def", but that file is

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-26 Thread William Moses via cfe-commits
https://github.com/wsmoses updated https://github.com/llvm/llvm-project/pull/70171 >From 547d498662c3b8da2cb87abe9f5c13b39123d90f Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Wed, 25 Oct 2023 02:10:32 -0500 Subject: [PATCH] [PassBuilder] Add a mechanism for adding passbuilder

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-26 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 3e79f4d2c24faaa24a4a12041b4c33d39fec2ec7 a49b8e2da32c1be06ea956198ba0d01006d64c92 --

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-26 Thread William Moses via cfe-commits
https://github.com/wsmoses updated https://github.com/llvm/llvm-project/pull/70171 >From a49b8e2da32c1be06ea956198ba0d01006d64c92 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Wed, 25 Oct 2023 02:10:32 -0500 Subject: [PATCH] [PassBuilder] Add a mechanism for adding passbuilder

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread William Moses via cfe-commits
https://github.com/wsmoses updated https://github.com/llvm/llvm-project/pull/70171 >From 227a494be06d8cb3b590c78f52f717bd781a8f0e Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Wed, 25 Oct 2023 02:10:32 -0500 Subject: [PATCH] [PassBuilder] Add a mechanism for adding passbuilder

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread William Moses via cfe-commits
https://github.com/wsmoses updated https://github.com/llvm/llvm-project/pull/70171 >From 5119368d060c886c6cb9c4209169604d191e6b4c Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Wed, 25 Oct 2023 02:10:32 -0500 Subject: [PATCH] [PassBuilder] Add a mechanism for adding passbuilder

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread William Moses via cfe-commits
wsmoses wrote: @jdoerfert added the example test @efriedma-quic I've reworked the mechanism to not create a global variable within LLVM. Here this only applies to clang and enables two things: 1) Users of clang as a library can add a custom passbuilder callback by adding to codegenoptions 2)

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread William Moses via cfe-commits
https://github.com/wsmoses updated https://github.com/llvm/llvm-project/pull/70171 >From ad9ed0260b1288efc3e8c7794f4de4592657474b Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Wed, 25 Oct 2023 02:10:32 -0500 Subject: [PATCH] [PassBuilder] Add a mechanism for adding passbuilder

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread William Moses via cfe-commits
wsmoses wrote: > acks presently can be done one of two ways: > > * a shared library plugin > * modifying the extensions list (and thus extensions.def) > > This prevents the use of such functionality for static builds on build > systems that cannot be modified, as well as prevents such

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I don't think a global variable is the right interface for this; we've been trying to move away from global variables because they cause breakage when LLVM is used in multiple contexts in the same process. Functions that construct pass pipelines that are usable as

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: Can you make an example on how this is used now? Is there a way to test this? https://github.com/llvm/llvm-project/pull/70171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread William Moses via cfe-commits
https://github.com/wsmoses updated https://github.com/llvm/llvm-project/pull/70171 >From fca61de1d6cf5fe68cfb51bfe5ca73d5d3948ba5 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Wed, 25 Oct 2023 02:10:32 -0500 Subject: [PATCH] [PassBuilder] Add a mechanism for adding passbuilder

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread William Moses via cfe-commits
https://github.com/wsmoses updated https://github.com/llvm/llvm-project/pull/70171 >From 8b0e0939ea51768b9e1257e816556d245c91134b Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Wed, 25 Oct 2023 02:10:32 -0500 Subject: [PATCH] [PassBuilder] Add a mechanism for adding passbuilder

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread William Moses via cfe-commits
https://github.com/wsmoses updated https://github.com/llvm/llvm-project/pull/70171 >From 9ccb8b7bff8adc03bf027766005762b350a803bc Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Wed, 25 Oct 2023 02:10:32 -0500 Subject: [PATCH] [PassBuilder] Add a mechanism for adding passbuilder

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: William Moses (wsmoses) Changes Adding passbuilder callbacks presently can be done one of two ways: * a shared library plugin * modifying the extensions list (and thus extensions.def) This prevents the use of such functionality

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread William Moses via cfe-commits
https://github.com/wsmoses created https://github.com/llvm/llvm-project/pull/70171 Adding passbuilder callbacks presently can be done one of two ways: * a shared library plugin * modifying the extensions list (and thus extensions.def) This prevents the use of such functionality for static