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/Analysis/MemoryBuiltins.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/Analysis/MemoryBuiltins.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemoryBuiltins.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp index af5ef4e..27005e5 100644 --- a/llvm/lib/Analysis/MemoryBuiltins.cpp +++ b/llvm/lib/Analysis/MemoryBuiltins.cpp @@ -508,10 +508,10 @@ llvm::getAllocationFamily(const Value *I, const TargetLibraryInfo *TLI) { // Callee is some known library function. const auto AllocData = getAllocationDataForFunction(Callee, AnyAlloc, TLI); if (AllocData) - return mangledNameForMallocFamily(AllocData.value().Family); + return mangledNameForMallocFamily(AllocData->Family); const auto FreeData = getFreeFunctionDataForFunction(Callee, TLIFn); if (FreeData) - return mangledNameForMallocFamily(FreeData.value().Family); + return mangledNameForMallocFamily(FreeData->Family); } // Callee isn't a known library function, still check attributes. if (checkFnAllocKind(I, AllocFnKind::Free | AllocFnKind::Alloc | |