[flang-commits] [flang] fed3d27 - [flang] Make SetLength TODO explicit in HLFIR

Jean Perier via flang-commits flang-commits at lists.llvm.org
Fri Dec 2 05:22:04 PST 2022


Author: Jean Perier
Date: 2022-12-02T14:21:27+01:00
New Revision: fed3d272da5a333ec4fad6f5556d60307ad03bd2

URL: https://github.com/llvm/llvm-project/commit/fed3d272da5a333ec4fad6f5556d60307ad03bd2
DIFF: https://github.com/llvm/llvm-project/commit/fed3d272da5a333ec4fad6f5556d60307ad03bd2.diff

LOG: [flang] Make SetLength TODO explicit in HLFIR

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.

Differential Revision: https://reviews.llvm.org/D139183

Added: 
    

Modified: 
    flang/lib/Lower/ConvertExprToHLFIR.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/ConvertExprToHLFIR.cpp b/flang/lib/Lower/ConvertExprToHLFIR.cpp
index 9daec6828a7a..f2e47ee96070 100644
--- a/flang/lib/Lower/ConvertExprToHLFIR.cpp
+++ b/flang/lib/Lower/ConvertExprToHLFIR.cpp
@@ -252,13 +252,7 @@ class HlfirDesignatorBuilder {
 //===--------------------------------------------------------------------===//
 
 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 @@ struct BinaryOp<Fortran::evaluate::ComplexConstructor<KIND>> {
   }
 };
 
+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:


        


More information about the flang-commits mailing list