[flang-commits] [flang] [flang][Lower] Convert OMP Map and related functions to evaluate::Expr (PR #81626)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Mon Mar 18 09:20:40 PDT 2024


================
@@ -808,14 +808,83 @@ genBaseBoundsOps(fir::FirOpBuilder &builder, mlir::Location loc,
   return bounds;
 }
 
+namespace detail {
+template <typename T> //
+static T &&AsRvalueRef(T &&t) {
+  return std::move(t);
+}
+template <typename T> //
+static T AsRvalueRef(T &t) {
+  return t;
+}
+template <typename T> //
+static T AsRvalueRef(const T &t) {
+  return t;
+}
+
+// Helper class for stripping enclosing parentheses and a conversion that
+// preserves type category. This is used for triplet elements, which are
+// always of type integer(kind=8). The lower/upper bounds are converted to
+// an "index" type, which is 64-bit, so the explicit conversion to kind=8
----------------
kparzysz wrote:

Ok.

Then I can remove this function to keep the semantics right, but the variable names in some test files will need to be updated to have the explicit "int(..., kind=8)" in there.  Would that be ok?

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


More information about the flang-commits mailing list