[clang] [openmp] [Clang][OpenMP] Mixed signed/unsigned trip counts fix (PR #226462)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 27 08:20:32 PDT 2026


================
@@ -17420,21 +17420,16 @@ SemaOpenMP::ActOnOpenMPFlattenDirective(ArrayRef<OMPClause *> Clauses,
   auto MakeDivisorInIVTy = [&](unsigned I) -> Expr * {
     Expr *N = MakeNumIterationsInIVTy(I);
     Expr *NCmp = MakeNumIterationsInIVTy(I);
-    auto MakeOne = [&]() -> ExprResult {
-      return SemaRef.PerformImplicitConversion(
-          SemaRef.ActOnIntegerConstant(CondLoc, 1).get(), IVTy,
-          AssignmentAction::Converting, /*AllowExplicit=*/true);
+    auto MakeOne = [&]() -> Expr * {
+      return IntegerLiteral::Create(Context, llvm::APInt(IVWidth, 1), IVTy,
----------------
alexey-bataev wrote:

```suggestion
    auto MakeCst = [&](uint64_t V) -> Expr * {
      return IntegerLiteral::Create(Context, llvm::APInt(IVWidth, V), IVTy,
```

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


More information about the cfe-commits mailing list