summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2025-09-19 14:09:33 -0500
committerGitHub <noreply@github.com>2025-09-19 14:09:33 -0500
commit580860e8b7341783e8e53114f26b9a9659a3a3e1 (patch)
tree8e6c7954d6b2493a9def789743bd10ab93e3e7f1 /openmp
parentb28d2ea432ab9ce04225874d893769be109be5c3 (diff)
[OpenMP][NFC] Clean up a bunch of warnings and clang-tidy messages (#159831)
Summary: I made the GPU flags accept more of the default LLVM warnings, which triggered some new cases. Clean those up and fix some other ones while I'm at it.
Diffstat (limited to 'openmp')
-rw-r--r--openmp/device/include/State.h2
-rw-r--r--openmp/device/src/Misc.cpp3
-rw-r--r--openmp/device/src/Synchronization.cpp2
-rw-r--r--openmp/tools/omptest/src/OmptAssertEvent.cpp3
4 files changed, 4 insertions, 6 deletions
diff --git a/openmp/device/include/State.h b/openmp/device/include/State.h
index db396dae6e44..cd6013780a49 100644
--- a/openmp/device/include/State.h
+++ b/openmp/device/include/State.h
@@ -327,6 +327,8 @@ private:
Ty Val;
bool Active;
};
+template <typename VTy, typename Ty>
+ValueRAII(VTy &, Ty, Ty, bool, IdentTy *, bool) -> ValueRAII<VTy, Ty>;
/// TODO
inline state::Value<uint32_t, state::VK_RunSchedChunk> RunSchedChunk;
diff --git a/openmp/device/src/Misc.cpp b/openmp/device/src/Misc.cpp
index a89f8b2a7453..563f674d166e 100644
--- a/openmp/device/src/Misc.cpp
+++ b/openmp/device/src/Misc.cpp
@@ -23,7 +23,7 @@ namespace impl {
/// Lookup a device-side function using a host pointer /p HstPtr using the table
/// provided by the device plugin. The table is an ordered pair of host and
/// device pointers sorted on the value of the host pointer.
-void *indirectCallLookup(void *HstPtr) {
+static void *indirectCallLookup(void *HstPtr) {
if (!HstPtr)
return nullptr;
@@ -114,6 +114,7 @@ void omp_free(void *ptr, omp_allocator_handle_t allocator) {
case omp_high_bw_mem_alloc:
case omp_low_lat_mem_alloc:
free(ptr);
+ return;
case omp_null_allocator:
default:
return;
diff --git a/openmp/device/src/Synchronization.cpp b/openmp/device/src/Synchronization.cpp
index 2f1ed34a3f6d..501dc4a291ed 100644
--- a/openmp/device/src/Synchronization.cpp
+++ b/openmp/device/src/Synchronization.cpp
@@ -57,8 +57,6 @@ uint32_t atomicInc(uint32_t *A, uint32_t V, atomic::OrderingTy Ordering,
ScopeSwitch(ORDER)
switch (Ordering) {
- default:
- __builtin_unreachable();
Case(atomic::relaxed);
Case(atomic::acquire);
Case(atomic::release);
diff --git a/openmp/tools/omptest/src/OmptAssertEvent.cpp b/openmp/tools/omptest/src/OmptAssertEvent.cpp
index bbf2d7cd4a10..a5a2e7969e98 100644
--- a/openmp/tools/omptest/src/OmptAssertEvent.cpp
+++ b/openmp/tools/omptest/src/OmptAssertEvent.cpp
@@ -24,9 +24,6 @@ const char *omptest::to_string(ObserveState State) {
return "Always";
case ObserveState::Never:
return "Never";
- default:
- assert(false && "Requested string representation for unknown ObserveState");
- return "UNKNOWN";
}
}