@@ -573,21 +573,37 @@ extern "C" LLVMRustResult LLVMRustOptimize(
573
573
if (PGOGenPath) {
574
574
assert (!PGOUsePath && !PGOSampleUsePath);
575
575
PGOOpt = PGOOptions (
576
+ #if LLVM_VERSION_GE(22, 0)
577
+ PGOGenPath, " " , " " , " " , PGOOptions::IRInstr, PGOOptions::NoCSAction,
578
+ #else
576
579
PGOGenPath, " " , " " , " " , FS, PGOOptions::IRInstr, PGOOptions::NoCSAction,
580
+ #endif
577
581
PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
578
582
} else if (PGOUsePath) {
579
583
assert (!PGOSampleUsePath);
580
584
PGOOpt = PGOOptions (
585
+ #if LLVM_VERSION_GE(22, 0)
586
+ PGOUsePath, " " , " " , " " , PGOOptions::IRUse, PGOOptions::NoCSAction,
587
+ #else
581
588
PGOUsePath, " " , " " , " " , FS, PGOOptions::IRUse, PGOOptions::NoCSAction,
589
+ #endif
582
590
PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
583
591
} else if (PGOSampleUsePath) {
584
592
PGOOpt =
593
+ #if LLVM_VERSION_GE(22, 0)
594
+ PGOOptions (PGOSampleUsePath, " " , " " , " " , PGOOptions::SampleUse,
595
+ #else
585
596
PGOOptions (PGOSampleUsePath, " " , " " , " " , FS, PGOOptions::SampleUse,
597
+ #endif
586
598
PGOOptions::NoCSAction, PGOOptions::ColdFuncOpt::Default,
587
599
DebugInfoForProfiling);
588
600
} else if (DebugInfoForProfiling) {
589
601
PGOOpt = PGOOptions (
602
+ #if LLVM_VERSION_GE(22, 0)
603
+ " " , " " , " " , " " , PGOOptions::NoAction, PGOOptions::NoCSAction,
604
+ #else
590
605
" " , " " , " " , " " , FS, PGOOptions::NoAction, PGOOptions::NoCSAction,
606
+ #endif
591
607
PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
592
608
}
593
609
0 commit comments