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/Support/VirtualFileSystem.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Support/VirtualFileSystem.cpp') diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index 1c0d2a044448..fb6ce477777a 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -2724,14 +2724,14 @@ void JSONWriter::write(ArrayRef Entries, OS << "{\n" " 'version': 0,\n"; if (IsCaseSensitive) - OS << " 'case-sensitive': '" - << (IsCaseSensitive.value() ? "true" : "false") << "',\n"; + OS << " 'case-sensitive': '" << (*IsCaseSensitive ? "true" : "false") + << "',\n"; if (UseExternalNames) - OS << " 'use-external-names': '" - << (UseExternalNames.value() ? "true" : "false") << "',\n"; + OS << " 'use-external-names': '" << (*UseExternalNames ? "true" : "false") + << "',\n"; bool UseOverlayRelative = false; if (IsOverlayRelative) { - UseOverlayRelative = IsOverlayRelative.value(); + UseOverlayRelative = *IsOverlayRelative; OS << " 'overlay-relative': '" << (UseOverlayRelative ? "true" : "false") << "',\n"; } -- cgit v1.2.3