[PATCH] D144970: [llvm-c] Remove bindings for creating legacy passes

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 01:19:08 PST 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/IPO.cpp:33
 
 void LLVMInitializeIPO(LLVMPassRegistryRef R) {
   initializeIPO(*unwrap(R));
----------------
nikic wrote:
> nikic wrote:
> > aeubanks wrote:
> > > nikic wrote:
> > > > aeubanks wrote:
> > > > > all of these initialize functions should also be deleted (everything in Initialization.h)
> > > > Isn't it necessary to still call initialization functions for passes used in the codegen pipeline?
> > > `LLVMInitializeIPO` (and others) are part of the C API, which as mentioned in the description can't be used for the codegen pipeline. We'll still keep around `llvm::initializeIPO` above. Actually we should just delete `LLVMPassRegistryRef` altogether
> > I'm referring to users of the codegen pipeline here. Is it not necessary to initialize codegen passes before using the codegen pipeline? Or is it only necessary if you want to refer to passes by name?
> Ah, I guess this is not necessary because passes call their own initialization function in their constructor (or at least that seems to be the convention), so they should get automatically initialized if created via the C++ API, rather than by name.
I've submitted a separate patch for this change (D145043), because I think it will be much higher impact than this one.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144970/new/

https://reviews.llvm.org/D144970



More information about the llvm-commits mailing list