[llvm-branch-commits] [flang] [llvm] [flang][OpenMP] Switch OpenMP version from unsigned to llvm::omp::Version (PR #219822)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Aug 30 09:13:08 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- flang/include/flang/Parser/openmp-utils.h flang/include/flang/Semantics/openmp-modifiers.h flang/include/flang/Semantics/openmp-utils.h flang/include/flang/Semantics/symbol.h flang/include/flang/Support/LangOptions.h flang/lib/Frontend/CompilerInvocation.cpp flang/lib/Frontend/FrontendActions.cpp flang/lib/Lower/OpenMP/Atomic.cpp flang/lib/Lower/OpenMP/ClauseProcessor.cpp flang/lib/Lower/OpenMP/ClauseProcessor.h flang/lib/Lower/OpenMP/DataSharingProcessor.cpp flang/lib/Lower/OpenMP/DataSharingProcessor.h flang/lib/Lower/OpenMP/Decomposer.cpp flang/lib/Lower/OpenMP/OpenMP.cpp flang/lib/Lower/PFTBuilder.cpp flang/lib/Parser/openmp-parsers.cpp flang/lib/Parser/openmp-utils.cpp flang/lib/Parser/unparse.cpp flang/lib/Semantics/check-omp-atomic.cpp flang/lib/Semantics/check-omp-loop.cpp flang/lib/Semantics/check-omp-structure.cpp flang/lib/Semantics/check-omp-variant.cpp flang/lib/Semantics/mod-file.cpp flang/lib/Semantics/openmp-utils.cpp flang/lib/Semantics/resolve-directives.cpp flang/unittests/Semantics/OpenMPUtils.cpp llvm/include/llvm/Frontend/OpenMP/OMPVersion.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp
index 2f5930890..ce1b0d06a 100644
--- a/flang/lib/Frontend/FrontendActions.cpp
+++ b/flang/lib/Frontend/FrontendActions.cpp
@@ -276,8 +276,8 @@ bool CodeGenAction::beginSourceFileAction() {
         lb.getModule(),
         makeOffloadModuleOpts(ci.getInvocation().getLangOpts()));
     llvm::omp::Version version = ci.getInvocation().getLangOpts().getOpenMP();
-    mlir::omp::setOpenMPVersionAttribute(
-        lb.getModule(), static_cast<unsigned>(version));
+    mlir::omp::setOpenMPVersionAttribute(lb.getModule(),
+                                         static_cast<unsigned>(version));
     if (!ci.getInvocation().getLoweringOpts().getIntegerWrapAround())
       mlir::omp::setOpenMPIntegerWrapAround(lb.getModule(), false);
   }
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPVersion.h b/llvm/include/llvm/Frontend/OpenMP/OMPVersion.h
index 6b8b533ea..fd8c2bfcb 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPVersion.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPVersion.h
@@ -45,9 +45,10 @@ inline constexpr bool operator<(Version A, int B) { return A < Version(B); }
 inline constexpr bool operator<=(Version A, int B) { return A <= Version(B); }
 inline constexpr bool operator>(Version A, int B) { return A > Version(B); }
 inline constexpr bool operator>=(Version A, int B) { return A >= Version(B); }
-//inline constexpr bool operator<(int A, Version B) { return Version(A) < B; }
-//inline constexpr bool operator<=(int A, Version B) { return Version(A) <= B; }
-//inline constexpr bool operator>=(int A, Version B) { return Version(A) >= B; }
+// inline constexpr bool operator<(int A, Version B) { return Version(A) < B; }
+// inline constexpr bool operator<=(int A, Version B) { return Version(A) <= B;
+// } inline constexpr bool operator>=(int A, Version B) { return Version(A) >=
+// B; }
 } // namespace omp
 
 template <> struct DenseMapInfo<omp::Version> {

``````````

</details>


https://github.com/llvm/llvm-project/pull/219822


More information about the llvm-branch-commits mailing list