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

William Moses via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 22:06:58 PDT 2023


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) Those who want to modify clang codegen passes can statically link the requisite code (like in the example) to enable their functionality, without forking clang. This still requires a global variable, but here it is limited to the clang driver itself, so it should not create any version conflicts since the clang driver should not load a second clang driver.

https://github.com/llvm/llvm-project/pull/70171


More information about the cfe-commits mailing list