[flang-commits] [PATCH] D139183: [flang] Make SetLength TODO explicit in HLFIR

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Dec 2 02:18:40 PST 2022


jeanPerier created this revision.
jeanPerier added a reviewer: clementval.
jeanPerier added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
Herald added a project: All.
jeanPerier requested review of this revision.

evaluate::SetLength is the last intrinsic binary operation
that needs to be lowered to HLFIR. It will require an hlfir.set_length
op or hlfir.as_expr to convert the result to an expression. Add a TODO
for now.

Depends on D139180 <https://reviews.llvm.org/D139180>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139183

Files:
  flang/lib/Lower/ConvertExprToHLFIR.cpp


Index: flang/lib/Lower/ConvertExprToHLFIR.cpp
===================================================================
--- flang/lib/Lower/ConvertExprToHLFIR.cpp
+++ flang/lib/Lower/ConvertExprToHLFIR.cpp
@@ -252,13 +252,7 @@
 //===--------------------------------------------------------------------===//
 
 template <typename T>
-struct BinaryOp {
-  static hlfir::EntityWithAttributes gen(mlir::Location loc,
-                                         fir::FirOpBuilder &builder, const T &,
-                                         hlfir::Entity lhs, hlfir::Entity rhs) {
-    TODO(loc, "binary op implementation in HLFIR");
-  }
-};
+struct BinaryOp {};
 
 #undef GENBIN
 #define GENBIN(GenBinEvOp, GenBinTyCat, GenBinFirOp)                           \
@@ -501,6 +495,17 @@
   }
 };
 
+template <int KIND>
+struct BinaryOp<Fortran::evaluate::SetLength<KIND>> {
+  using Op = Fortran::evaluate::SetLength<KIND>;
+  static hlfir::EntityWithAttributes gen(mlir::Location loc,
+                                         fir::FirOpBuilder &builder,
+                                         const Op &op, hlfir::Entity lhs,
+                                         hlfir::Entity rhs) {
+    TODO(loc, "SetLength lowering to HLFIR");
+  }
+};
+
 /// Lower Expr to HLFIR.
 class HlfirBuilder {
 public:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139183.479563.patch
Type: text/x-patch
Size: 1295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20221202/478c332a/attachment.bin>


More information about the flang-commits mailing list