aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-12-17 00:42:05 +0000
committerFangrui Song <i@maskray.me>2022-12-17 00:42:05 +0000
commit21c4dc7997b83e83f87c26a97c104dcdd95f1d0f (patch)
treed206072152eb158d6d0eb6c3b93abca9aeb101c6 /llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
parent2e9c3fe6fcfd7b4672facec87dceb76ff3c83566 (diff)
downloadllvm-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/Transforms/Instrumentation/ThreadSanitizer.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
index e2fc48b..c6c5995 100644
--- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
@@ -485,7 +485,7 @@ static bool isTsanAtomic(const Instruction *I) {
if (!SSID)
return false;
if (isa<LoadInst>(I) || isa<StoreInst>(I))
- return SSID.value() != SyncScope::SingleThread;
+ return *SSID != SyncScope::SingleThread;
return true;
}