From 2fa744e631cbabe583da010ec56560edbc7a5384 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 16 Dec 2022 22:44:08 +0000 Subject: std::optional::value => operator*/operator-> value() has undesired exception checking semantics and calls __throw_bad_optional_access in libc++. Moreover, the API is unavailable without _LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). This commit fixes LLVMAnalysis and its dependencies. --- llvm/lib/IR/LLVMContextImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/IR/LLVMContextImpl.cpp') diff --git a/llvm/lib/IR/LLVMContextImpl.cpp b/llvm/lib/IR/LLVMContextImpl.cpp index e0e25f2..e3917f1 100644 --- a/llvm/lib/IR/LLVMContextImpl.cpp +++ b/llvm/lib/IR/LLVMContextImpl.cpp @@ -259,7 +259,7 @@ bool LLVMContextImpl::getOpaquePointers() { } void LLVMContextImpl::setOpaquePointers(bool OP) { - assert((!OpaquePointers || OpaquePointers.value() == OP) && + assert((!OpaquePointers || *OpaquePointers == OP) && "Cannot change opaque pointers mode once set"); OpaquePointers = OP; } -- cgit v1.1