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

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Mon Mar 18 18:00:17 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
----------------
clementval wrote:

Ok I see. This is indeed not ideal since the name is meant to be used for error reporting and so on and should at much as possible represent what was in the original code. Would it be possible to peal the expr only when we use it with the asFortran stringstream and keep the real expression to keep the semantic right?


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


More information about the flang-commits mailing list