diff options
author | Fangrui Song <i@maskray.me> | 2022-12-16 22:44:08 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-16 22:44:08 +0000 |
commit | 2fa744e631cbabe583da010ec56560edbc7a5384 (patch) | |
tree | db931423c9394a852b65bdf5072ba997463114d5 /llvm/lib/Support/VirtualFileSystem.cpp | |
parent | 27249c06b775c73b7fa9f2d8e48cac1a85169481 (diff) | |
download | llvm-2fa744e631cbabe583da010ec56560edbc7a5384.zip llvm-2fa744e631cbabe583da010ec56560edbc7a5384.tar.gz llvm-2fa744e631cbabe583da010ec56560edbc7a5384.tar.bz2 |
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.
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r-- | llvm/lib/Support/VirtualFileSystem.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index 1c0d2a0..fb6ce47 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -2724,14 +2724,14 @@ void JSONWriter::write(ArrayRef<YAMLVFSEntry> 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"; } |