Skip to content

Commit 156cfb3

Browse files
committed
llvm: update remarks support on LLVM 22
LLVM change dfbd76bda01e removed separate remark support entirely, but it turns out we can just drop the parameter and everything appears to work fine. Fixes #146912 as far as I can tell (the test passes.) @rustbot label llvm-main
1 parent ce4beeb commit 156cfb3

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
@@ -1779,9 +1779,14 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler(
17791779
// Do not delete the file after we gather remarks
17801780
RemarkFile->keep();
17811781

1782+
#if LLVM_VERSION_GE(22, 0)
1783+
auto RemarkSerializer = remarks::createRemarkSerializer(
1784+
llvm::remarks::Format::YAML, RemarkFile->os());
1785+
#else
17821786
auto RemarkSerializer = remarks::createRemarkSerializer(
17831787
llvm::remarks::Format::YAML, remarks::SerializerMode::Separate,
17841788
RemarkFile->os());
1789+
#endif
17851790
if (Error E = RemarkSerializer.takeError()) {
17861791
std::string Error = std::string("Cannot create remark serializer: ") +
17871792
toString(std::move(E));

0 commit comments

Comments
 (0)