How to port my plugin to clang-14

Hi all,
I have just updated to clang-14 and unfortunately now I cannot compile my plugin anymore and I cannot understand how to fix it atm. I register it using the following code

#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Passes/PassPlugin.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/IR/IRBuilder.h"

....

llvm::PassPluginLibraryInfo getSEPPluginInfo() {
    return {LLVM_PLUGIN_API_VERSION, "SEP", LLVM_VERSION_STRING,
        [](PassBuilder & PB) {
            PB.registerPipelineStartEPCallback(
                    [](ModulePassManager &MPM, PassBuilder::OptimizationLevel Level) {
                        FunctionPassManager FPM;
                        MPM.addPass(SEP());
                        MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
                    });
        }};
}

I have the folowing errors:

error: ‘llvm::PassBuilder::OptimizationLevel’ has not been declared
   97 |                     [](ModulePassManager &MPM, PassBuilder::OptimizationLevel Level) {
error: cannot convert ‘getSEPPluginInfo()::<lambda(llvm::PassBuilder&)>::<lambda(llvm::ModulePassManager&, int)>’ to ‘const std::function<void(llvm::PassManager<llvm::Module>&, llvm::OptimizationLevel)>&’
   96 |             PB.registerPipelineStartEPCallback(
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   97 |                     [](ModulePassManager &MPM, PassBuilder::OptimizationLevel Level) {
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   98 |                         FunctionPassManager FPM;
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~
   99 |                         MPM.addPass(SEP());
      |                         ~~~~~~~~~~~~~~~~~~~    
  100 |                         MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101 |                     });

Any help?

Thanks

Apparently I fixed it using llvm::OptimizationLevel Level is it the correct way?

Thanks

Yes. The class was moved by D107025.

Regards,
Kai

Great, thanks