[PATCH] D99459: [OpenMP] Implement '#pragma omp unroll'.

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 14 07:25:11 PDT 2021


ABataev added a comment.

Some previous comments were not addressed yet



================
Comment at: clang/include/clang/AST/OpenMPClause.h:972-974
+  /// Sets the location of '('.
+  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
+
----------------
Make it private


================
Comment at: clang/lib/AST/StmtOpenMP.cpp:141
+      } else
+        break;
+
----------------
Enclose in braces


================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:2600-2604
+      RValue FactorRVal = EmitAnyExpr(FactorExpr, AggValueSlot::ignored(),
+                                      /*ignoreResult=*/true);
+      Factor =
+          cast<llvm::ConstantInt>(FactorRVal.getScalarVal())->getZExtValue();
+      assert(Factor >= 1 && "Only positive factors are valid");
----------------
I suppose it is compiled-time expression, right? If so, use `FactorExpr->EvaluateKnownConstInt()` or something similar.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99459/new/

https://reviews.llvm.org/D99459



More information about the cfe-commits mailing list