mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Avoid LLVM-deprecated Optional::hasValue
LLVM 15 added `Optional::has_value`, and LLVM `main` (16) has deprecated `hasValue`. However, its `explicit operator bool` does the same thing, and was added long ago, so we can use that across our full LLVM range of compatibility.
This commit is contained in:
parent
8b705839cd
commit
35adb36779
@ -1044,7 +1044,7 @@ extern "C" void LLVMRustSetModulePIELevel(LLVMModuleRef M) {
|
|||||||
extern "C" void LLVMRustSetModuleCodeModel(LLVMModuleRef M,
|
extern "C" void LLVMRustSetModuleCodeModel(LLVMModuleRef M,
|
||||||
LLVMRustCodeModel Model) {
|
LLVMRustCodeModel Model) {
|
||||||
auto CM = fromRust(Model);
|
auto CM = fromRust(Model);
|
||||||
if (!CM.hasValue())
|
if (!CM)
|
||||||
return;
|
return;
|
||||||
unwrap(M)->setCodeModel(*CM);
|
unwrap(M)->setCodeModel(*CM);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user