diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-09-27 21:42:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-27 21:42:24 +0200 |
| commit | e1fb698c44d3c14d7eea1013a3a456bce95d1393 (patch) | |
| tree | db2309d0ee49006dd75a36ee8dfd11e83d3f0ac5 | |
| parent | b32ce95911bfa2c0d972b292d7d5f76bf9c51bc9 (diff) | |
| parent | 35adb367798476eb49d3e77d44999b5f8ce8fa34 (diff) | |
| download | rust-e1fb698c44d3c14d7eea1013a3a456bce95d1393.tar.gz rust-e1fb698c44d3c14d7eea1013a3a456bce95d1393.zip | |
Rollup merge of #102337 - cuviper:llvm-optional-bool, r=nikic
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.
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 09f377d349f..879a3b660b4 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -1044,7 +1044,7 @@ extern "C" void LLVMRustSetModulePIELevel(LLVMModuleRef M) { extern "C" void LLVMRustSetModuleCodeModel(LLVMModuleRef M, LLVMRustCodeModel Model) { auto CM = fromRust(Model); - if (!CM.hasValue()) + if (!CM) return; unwrap(M)->setCodeModel(*CM); } |
