Skip to content

Commit b3f9556

Browse files
authored
Unrolled build for #147050
Rollup merge of #147050 - durin42:llvm-22-pgo-options-args, r=cuviper PassWrapper: update for new PGOOptions args in LLVM 22 This changed in upstream change llvm/llvm-project@a5569b4. ``@rustbot`` label llvm-main
2 parents 4082d6a + bd860bd commit b3f9556

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,25 +569,43 @@ extern "C" LLVMRustResult LLVMRustOptimize(
569569
}
570570

571571
std::optional<PGOOptions> PGOOpt;
572+
#if LLVM_VERSION_LT(22, 0)
572573
auto FS = vfs::getRealFileSystem();
574+
#endif
573575
if (PGOGenPath) {
574576
assert(!PGOUsePath && !PGOSampleUsePath);
575577
PGOOpt = PGOOptions(
578+
#if LLVM_VERSION_GE(22, 0)
579+
PGOGenPath, "", "", "", PGOOptions::IRInstr, PGOOptions::NoCSAction,
580+
#else
576581
PGOGenPath, "", "", "", FS, PGOOptions::IRInstr, PGOOptions::NoCSAction,
582+
#endif
577583
PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
578584
} else if (PGOUsePath) {
579585
assert(!PGOSampleUsePath);
580586
PGOOpt = PGOOptions(
587+
#if LLVM_VERSION_GE(22, 0)
588+
PGOUsePath, "", "", "", PGOOptions::IRUse, PGOOptions::NoCSAction,
589+
#else
581590
PGOUsePath, "", "", "", FS, PGOOptions::IRUse, PGOOptions::NoCSAction,
591+
#endif
582592
PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
583593
} else if (PGOSampleUsePath) {
584594
PGOOpt =
595+
#if LLVM_VERSION_GE(22, 0)
596+
PGOOptions(PGOSampleUsePath, "", "", "", PGOOptions::SampleUse,
597+
#else
585598
PGOOptions(PGOSampleUsePath, "", "", "", FS, PGOOptions::SampleUse,
599+
#endif
586600
PGOOptions::NoCSAction, PGOOptions::ColdFuncOpt::Default,
587601
DebugInfoForProfiling);
588602
} else if (DebugInfoForProfiling) {
589603
PGOOpt = PGOOptions(
604+
#if LLVM_VERSION_GE(22, 0)
605+
"", "", "", "", PGOOptions::NoAction, PGOOptions::NoCSAction,
606+
#else
590607
"", "", "", "", FS, PGOOptions::NoAction, PGOOptions::NoCSAction,
608+
#endif
591609
PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
592610
}
593611

0 commit comments

Comments
 (0)