Skip to content

Commit f9c040b

Browse files
committed
llvm: disable remarks support on LLVM 22
LLVM change dfbd76bda01e removed separate remark support entirely. That's the only mode we actually used, and it doesn't appear to be a quick change to clean that up. It also appears to be a relatively obscure unstable feature from looking in the test suite, so I'll disable it in LLVM 22 for now so we continue to get CI coverage for the rest of our functionality. @rustbot label llvm-main
1 parent ce4beeb commit f9c040b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,10 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler(
17621762
std::unique_ptr<LLVMRemarkStreamer> LlvmRemarkStreamer;
17631763

17641764
if (RemarkFilePath != nullptr) {
1765+
#if LLVM_VERSION_GE(22, 0)
1766+
report_fatal_error(
1767+
"optimization remark-dir unimplemented on LLVM 22 and later");
1768+
#else
17651769
if (PGOAvailable) {
17661770
// Enable PGO hotness data for remarks, if available
17671771
unwrap(C)->setDiagnosticsHotnessRequested(true);
@@ -1790,6 +1794,7 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler(
17901794
RemarkStreamer = std::make_unique<llvm::remarks::RemarkStreamer>(
17911795
std::move(*RemarkSerializer));
17921796
LlvmRemarkStreamer = std::make_unique<LLVMRemarkStreamer>(*RemarkStreamer);
1797+
#endif
17931798
}
17941799

17951800
unwrap(C)->setDiagnosticHandler(std::make_unique<RustDiagnosticHandler>(

0 commit comments

Comments
 (0)