about summary refs log tree commit diff
path: root/compiler/rustc_llvm
diff options
context:
space:
mode:
authorAugie Fackler <augie@google.com>2025-09-25 18:12:33 -0400
committerAugie Fackler <augie@google.com>2025-09-25 18:24:16 -0400
commit7a9b6d94d41720a206d0e52e4827bac45d9a7bc3 (patch)
treed52c7b1d4a54230ae2e07fc79d484d3e05a4eeaf /compiler/rustc_llvm
parent6f34f4ee074ce0affc7bbf4e2c835f66cd576f13 (diff)
downloadrust-7a9b6d94d41720a206d0e52e4827bac45d9a7bc3.tar.gz
rust-7a9b6d94d41720a206d0e52e4827bac45d9a7bc3.zip
PassWrapper: update for new PGOOptions args in LLVM 22
This changed in upstream change a5569b4bd7f8.

@rustbot label llvm-main
Diffstat (limited to 'compiler/rustc_llvm')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index 013d68fa3e4..136b6e9bf50 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -573,21 +573,37 @@ extern "C" LLVMRustResult LLVMRustOptimize(
   if (PGOGenPath) {
     assert(!PGOUsePath && !PGOSampleUsePath);
     PGOOpt = PGOOptions(
+#if LLVM_VERSION_GE(22, 0)
+        PGOGenPath, "", "", "", PGOOptions::IRInstr, PGOOptions::NoCSAction,
+#else
         PGOGenPath, "", "", "", FS, PGOOptions::IRInstr, PGOOptions::NoCSAction,
+#endif
         PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
   } else if (PGOUsePath) {
     assert(!PGOSampleUsePath);
     PGOOpt = PGOOptions(
+#if LLVM_VERSION_GE(22, 0)
+        PGOUsePath, "", "", "", PGOOptions::IRUse, PGOOptions::NoCSAction,
+#else
         PGOUsePath, "", "", "", FS, PGOOptions::IRUse, PGOOptions::NoCSAction,
+#endif
         PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
   } else if (PGOSampleUsePath) {
     PGOOpt =
+#if LLVM_VERSION_GE(22, 0)
+        PGOOptions(PGOSampleUsePath, "", "", "", PGOOptions::SampleUse,
+#else
         PGOOptions(PGOSampleUsePath, "", "", "", FS, PGOOptions::SampleUse,
+#endif
                    PGOOptions::NoCSAction, PGOOptions::ColdFuncOpt::Default,
                    DebugInfoForProfiling);
   } else if (DebugInfoForProfiling) {
     PGOOpt = PGOOptions(
+#if LLVM_VERSION_GE(22, 0)
+        "", "", "", "", PGOOptions::NoAction, PGOOptions::NoCSAction,
+#else
         "", "", "", "", FS, PGOOptions::NoAction, PGOOptions::NoCSAction,
+#endif
         PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
   }