diff options
author | Fangrui Song <i@maskray.me> | 2022-12-17 00:42:05 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-17 00:42:05 +0000 |
commit | 21c4dc7997b83e83f87c26a97c104dcdd95f1d0f (patch) | |
tree | d206072152eb158d6d0eb6c3b93abca9aeb101c6 /llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp | |
parent | 2e9c3fe6fcfd7b4672facec87dceb76ff3c83566 (diff) | |
download | llvm-21c4dc7997b83e83f87c26a97c104dcdd95f1d0f.zip llvm-21c4dc7997b83e83f87c26a97c104dcdd95f1d0f.tar.gz llvm-21c4dc7997b83e83f87c26a97c104dcdd95f1d0f.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 fixes clang.
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp b/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp index 26884a5a..5f27073 100644 --- a/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp +++ b/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp @@ -2318,13 +2318,13 @@ bool SIMemoryLegalizer::runOnMachineFunction(MachineFunction &MF) { continue; if (const auto &MOI = MOA.getLoadInfo(MI)) - Changed |= expandLoad(MOI.value(), MI); + Changed |= expandLoad(*MOI, MI); else if (const auto &MOI = MOA.getStoreInfo(MI)) - Changed |= expandStore(MOI.value(), MI); + Changed |= expandStore(*MOI, MI); else if (const auto &MOI = MOA.getAtomicFenceInfo(MI)) - Changed |= expandAtomicFence(MOI.value(), MI); + Changed |= expandAtomicFence(*MOI, MI); else if (const auto &MOI = MOA.getAtomicCmpxchgOrRmwInfo(MI)) - Changed |= expandAtomicCmpxchgOrRmw(MOI.value(), MI); + Changed |= expandAtomicCmpxchgOrRmw(*MOI, MI); } } |