https://github.com/kparzysz created 
https://github.com/llvm/llvm-project/pull/236089

It was unsigned before. The goal is to unify Version and VersionRange,
and VersionRange stores versions as int.

---

<sub>Stack created with <a href="https://github.com/github/gh-stack";>GitHub 
Stacks CLI</a> • <a href="https://gh.io/stacks-feedback";>Give Feedback 
💬</a></sub>

>From c9b716593e50c2710e18f644191b706b379b6c03 Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <[email protected]>
Date: Wed, 7 Oct 2026 07:07:40 -0500
Subject: [PATCH] [OpenMP] Switch the underlying type of llvm::omp::Version to
 int

It was unsigned before. The goal is to unify Version and VersionRange,
and VersionRange stores versions as int.
---
 flang/include/flang/Parser/openmp-utils.h      | 2 +-
 flang/lib/Parser/openmp-utils.cpp              | 2 +-
 llvm/include/llvm/Frontend/OpenMP/OMPVersion.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/flang/include/flang/Parser/openmp-utils.h 
b/flang/include/flang/Parser/openmp-utils.h
index 817ac1ce59d3f..4a00b68a2939f 100644
--- a/flang/include/flang/Parser/openmp-utils.h
+++ b/flang/include/flang/Parser/openmp-utils.h
@@ -80,7 +80,7 @@ template <typename ElemTy, typename OwnerTy>
 llvm::directive::VersionRange GetVersionRangeForElement(
     ElemTy elemId, OwnerTy ownerId) {
   llvm::omp::Version minVer{std::numeric_limits<int>::max()};
-  llvm::omp::Version maxVer{0u};
+  llvm::omp::Version maxVer{0};
   const auto &desc{llvm::omp::getDescriptor(ownerId)};
   for (llvm::omp::Version v : desc.getVersions()) {
     if (GetAllowedElements(desc, v).test(elemId)) {
diff --git a/flang/lib/Parser/openmp-utils.cpp 
b/flang/lib/Parser/openmp-utils.cpp
index a1b39b13cedd5..fcd9e75e04bd8 100644
--- a/flang/lib/Parser/openmp-utils.cpp
+++ b/flang/lib/Parser/openmp-utils.cpp
@@ -57,7 +57,7 @@ llvm::omp::Modifiers GetElements(const 
llvm::omp::descriptor::ModifierSet &desc,
 llvm::directive::VersionRange GetVersionRangeForDirective(
     llvm::omp::Directive dirId) {
   llvm::omp::Version minVer{std::numeric_limits<int>::max()};
-  llvm::omp::Version maxVer{0u};
+  llvm::omp::Version maxVer{0};
   auto &desc = llvm::omp::getDescriptor(dirId);
   for (llvm::omp::Version v : desc.getVersions()) {
     minVer = std::min(minVer, v);
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPVersion.h 
b/llvm/include/llvm/Frontend/OpenMP/OMPVersion.h
index f898809d47d3f..623d698b7fb80 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPVersion.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPVersion.h
@@ -18,7 +18,7 @@
 namespace llvm {
 namespace omp {
 struct Version {
-  using value_type = unsigned;
+  using value_type = int;
   constexpr explicit Version(value_type Ver = 0) : V(Ver) {}
   constexpr explicit operator bool() const { return V != 0; }
   constexpr value_type value() const { return V; }

_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to