@@ -573,21 +573,37 @@ extern "C" LLVMRustResult LLVMRustOptimize(
573573 if (PGOGenPath) {
574574 assert (!PGOUsePath && !PGOSampleUsePath);
575575 PGOOpt = PGOOptions (
576+ #if LLVM_VERSION_GE(22, 0)
577+ PGOGenPath, " " , " " , " " , PGOOptions::IRInstr, PGOOptions::NoCSAction,
578+ #else
576579 PGOGenPath, " " , " " , " " , FS, PGOOptions::IRInstr, PGOOptions::NoCSAction,
580+ #endif
577581 PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
578582 } else if (PGOUsePath) {
579583 assert (!PGOSampleUsePath);
580584 PGOOpt = PGOOptions (
585+ #if LLVM_VERSION_GE(22, 0)
586+ PGOUsePath, " " , " " , " " , PGOOptions::IRUse, PGOOptions::NoCSAction,
587+ #else
581588 PGOUsePath, " " , " " , " " , FS, PGOOptions::IRUse, PGOOptions::NoCSAction,
589+ #endif
582590 PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
583591 } else if (PGOSampleUsePath) {
584592 PGOOpt =
593+ #if LLVM_VERSION_GE(22, 0)
594+ PGOOptions (PGOSampleUsePath, " " , " " , " " , PGOOptions::SampleUse,
595+ #else
585596 PGOOptions (PGOSampleUsePath, " " , " " , " " , FS, PGOOptions::SampleUse,
597+ #endif
586598 PGOOptions::NoCSAction, PGOOptions::ColdFuncOpt::Default,
587599 DebugInfoForProfiling);
588600 } else if (DebugInfoForProfiling) {
589601 PGOOpt = PGOOptions (
602+ #if LLVM_VERSION_GE(22, 0)
603+ " " , " " , " " , " " , PGOOptions::NoAction, PGOOptions::NoCSAction,
604+ #else
590605 " " , " " , " " , " " , FS, PGOOptions::NoAction, PGOOptions::NoCSAction,
606+ #endif
591607 PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
592608 }
593609
0 commit comments