ArchiveWrapper: handle LLVM API update

In llvm/llvm-project@f740bcb370 a boolean
parameter changed to an enum.

r? @nikic
@rustbot label: +llvm-main
This commit is contained in:
Augie Fackler 2023-08-22 12:26:35 -04:00
parent d8c69dfb37
commit 3977ed1e69

View File

@ -203,7 +203,12 @@ LLVMRustWriteArchive(char *Dst, size_t NumMembers,
}
}
#if LLVM_VERSION_LT(18, 0)
auto Result = writeArchive(Dst, Members, WriteSymbtab, Kind, true, false);
#else
auto SymtabMode = WriteSymbtab ? SymtabWritingMode::NormalSymtab : SymtabWritingMode::NoSymtab;
auto Result = writeArchive(Dst, Members, SymtabMode, Kind, true, false);
#endif
if (!Result)
return LLVMRustResult::Success;
LLVMRustSetLastError(toString(std::move(Result)).c_str());