Skip to content

Commit 1446bd6

Browse files
committed
PassWrapper: update for new PGOOptions args in LLVM 22
This changed in upstream change a5569b4bd7f8. @rustbot label llvm-main
1 parent 6f34f4e commit 1446bd6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)