[flang-commits] [flang] 331145e - [flang][NFC] Unify todo messages

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Mon Jun 20 06:44:29 PDT 2022


Author: Valentin Clement
Date: 2022-06-20T15:44:20+02:00
New Revision: 331145e6e979ddb115e3bfd44d282828994d4e23

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

LOG: [flang][NFC] Unify todo messages

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Peter Steinfeld <psteinfeld at nvidia.com>

Added: 
    

Modified: 
    flang/include/flang/Optimizer/Builder/Todo.h
    flang/lib/Lower/Allocatable.cpp
    flang/lib/Lower/Bridge.cpp
    flang/lib/Lower/CallInterface.cpp
    flang/lib/Lower/ConvertExpr.cpp
    flang/lib/Lower/ConvertType.cpp
    flang/lib/Lower/VectorSubscripts.cpp
    flang/lib/Optimizer/Builder/MutableBox.cpp
    flang/test/Fir/Todo/allocmem.fir
    flang/test/Fir/Todo/coordinate_of_1.fir
    flang/test/Fir/Todo/coordinate_of_2.fir
    flang/test/Fir/Todo/coordinate_of_3.fir
    flang/test/Fir/Todo/coordinate_of_4.fir
    flang/test/Fir/Todo/dispatch.fir
    flang/test/Fir/Todo/dispatch_table.fir
    flang/test/Fir/Todo/end.fir
    flang/test/Fir/Todo/gentypedesc.fir
    flang/test/Fir/Todo/global_len.fir
    flang/test/Fir/Todo/len_param_index.fir
    flang/test/Fir/Todo/select_case_with_character.fir
    flang/test/Lower/derived-types.f90

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Optimizer/Builder/Todo.h b/flang/include/flang/Optimizer/Builder/Todo.h
index 0ffbdc59a259c..a0bf0e44f731d 100644
--- a/flang/include/flang/Optimizer/Builder/Todo.h
+++ b/flang/include/flang/Optimizer/Builder/Todo.h
@@ -34,16 +34,16 @@
 // In a release build, just give a message and exit.
 #define TODO_NOLOC(ToDoMsg)                                                    \
   do {                                                                         \
-    llvm::errs() << __FILE__ << ':' << __LINE__ << ": not yet implemented "    \
-                 << ToDoMsg << '\n';                                           \
+    llvm::errs() << __FILE__ << ':' << __LINE__                                \
+                 << ": not yet implemented: " << ToDoMsg << '\n';              \
     std::exit(1);                                                              \
   } while (false)
 
 #undef TODO_DEFN
 #define TODO_DEFN(MlirLoc, ToDoMsg, ToDoFile, ToDoLine)                        \
   do {                                                                         \
-    mlir::emitError(MlirLoc, ToDoFile                                          \
-                    ":" TODOQUOTE(ToDoLine) ": not yet implemented " ToDoMsg); \
+    mlir::emitError(MlirLoc, ToDoFile ":" TODOQUOTE(                           \
+                                 ToDoLine) ": not yet implemented: " ToDoMsg); \
     std::exit(1);                                                              \
   } while (false)
 
@@ -56,7 +56,7 @@
 #define TODO_NOLOCDEFN(ToDoMsg, ToDoFile, ToDoLine)                            \
   do {                                                                         \
     llvm::report_fatal_error(                                                  \
-        __FILE__ ":" TODOQUOTE(__LINE__) ": not yet implemented " ToDoMsg);    \
+        ToDoFile ":" TODOQUOTE(ToDoLine) ": not yet implemented: " ToDoMsg);   \
   } while (false)
 
 #define TODO_NOLOC(ToDoMsg) TODO_NOLOCDEFN(ToDoMsg, __FILE__, __LINE__)
@@ -66,7 +66,7 @@
   do {                                                                         \
     fir::emitFatalError(                                                       \
         MlirLoc,                                                               \
-        ToDoFile ":" TODOQUOTE(ToDoLine) ": not yet implemented " ToDoMsg);    \
+        ToDoFile ":" TODOQUOTE(ToDoLine) ": not yet implemented: " ToDoMsg);   \
   } while (false)
 
 #define TODO(MlirLoc, ToDoMsg) TODO_DEFN(MlirLoc, ToDoMsg, __FILE__, __LINE__)

diff  --git a/flang/lib/Lower/Allocatable.cpp b/flang/lib/Lower/Allocatable.cpp
index d8ae0a9c91f4c..0bd2cb250ef94 100644
--- a/flang/lib/Lower/Allocatable.cpp
+++ b/flang/lib/Lower/Allocatable.cpp
@@ -430,7 +430,7 @@ class AllocateStmtHelper {
     if (const Fortran::semantics::DerivedTypeSpec *derived =
             typeSpec->AsDerived())
       if (Fortran::semantics::CountLenParameters(*derived) > 0)
-        TODO(loc, "TODO: setting derived type params in allocation");
+        TODO(loc, "setting derived type params in allocation");
     if (typeSpec->category() ==
         Fortran::semantics::DeclTypeSpec::Category::Character) {
       Fortran::semantics::ParamValue lenParam =
@@ -468,7 +468,7 @@ class AllocateStmtHelper {
     TODO(loc, "MOLD allocation lowering");
   }
   void genSetType(const Allocation &, const fir::MutableBoxValue &) {
-    TODO(loc, "Polymorphic entity allocation lowering");
+    TODO(loc, "polymorphic entity allocation lowering");
   }
 
   /// Returns a pointer to the DeclTypeSpec if a type-spec is provided in the

diff  --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index 6caea151c20e8..dea8d3d3063f6 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -2840,7 +2840,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
       const Fortran::semantics::Symbol &procSymbol =
           funit.getSubprogramSymbol();
       if (procSymbol.owner().IsSubmodule()) {
-        TODO(toLocation(), "support submodules");
+        TODO(toLocation(), "support for submodules");
         return;
       }
     }

diff  --git a/flang/lib/Lower/CallInterface.cpp b/flang/lib/Lower/CallInterface.cpp
index faec2916787d4..bea0302ea9428 100644
--- a/flang/lib/Lower/CallInterface.cpp
+++ b/flang/lib/Lower/CallInterface.cpp
@@ -807,13 +807,13 @@ class Fortran::lower::CallInterfaceImpl {
     if (obj.attrs.test(Attrs::Optional))
       addMLIRAttr(fir::getOptionalAttrName());
     if (obj.attrs.test(Attrs::Asynchronous))
-      TODO(loc, "Asynchronous in procedure interface");
+      TODO(loc, "ASYNCHRONOUS in procedure interface");
     if (obj.attrs.test(Attrs::Contiguous))
       addMLIRAttr(fir::getContiguousAttrName());
     if (obj.attrs.test(Attrs::Value))
       isValueAttr = true; // TODO: do we want an mlir::Attribute as well?
     if (obj.attrs.test(Attrs::Volatile))
-      TODO(loc, "Volatile in procedure interface");
+      TODO(loc, "VOLATILE in procedure interface");
     if (obj.attrs.test(Attrs::Target))
       addMLIRAttr(fir::getTargetAttrName());
 
@@ -823,9 +823,9 @@ class Fortran::lower::CallInterfaceImpl {
     const Fortran::evaluate::characteristics::TypeAndShape::Attrs &shapeAttrs =
         obj.type.attrs();
     if (shapeAttrs.test(ShapeAttr::AssumedRank))
-      TODO(loc, "Assumed Rank in procedure interface");
+      TODO(loc, "assumed rank in procedure interface");
     if (shapeAttrs.test(ShapeAttr::Coarray))
-      TODO(loc, "Coarray in procedure interface");
+      TODO(loc, "coarray in procedure interface");
 
     // So far assume that if the argument cannot be passed by implicit interface
     // it must be by box. That may no be always true (e.g for simple optionals)

diff  --git a/flang/lib/Lower/ConvertExpr.cpp b/flang/lib/Lower/ConvertExpr.cpp
index 660de0b88c02f..bc073a1d95279 100644
--- a/flang/lib/Lower/ConvertExpr.cpp
+++ b/flang/lib/Lower/ConvertExpr.cpp
@@ -1060,7 +1060,7 @@ class ScalarExprLowering {
       TODO(loc, "rank inquiry on assumed rank");
     case Fortran::evaluate::DescriptorInquiry::Field::Stride:
       // So far the front end does not generate this inquiry.
-      TODO(loc, "Stride inquiry");
+      TODO(loc, "stride inquiry");
     }
     llvm_unreachable("unknown descriptor inquiry");
   }
@@ -2319,7 +2319,7 @@ class ScalarExprLowering {
       if (charType.hasDynamicLen() && allocMemTypeParams.empty())
         allocMemTypeParams.push_back(charLen);
     } else if (fir::hasDynamicSize(elementType)) {
-      TODO(loc, "Creating temporary for derived type with length parameters");
+      TODO(loc, "creating temporary for derived type with length parameters");
     }
 
     mlir::Value temp = builder.create<fir::AllocMemOp>(

diff  --git a/flang/lib/Lower/ConvertType.cpp b/flang/lib/Lower/ConvertType.cpp
index 04c073bf8788e..f32504d67f3cf 100644
--- a/flang/lib/Lower/ConvertType.cpp
+++ b/flang/lib/Lower/ConvertType.cpp
@@ -161,7 +161,7 @@ struct TypeBuilder {
       int rank = expr.Rank();
       if (rank < 0)
         TODO(converter.getCurrentLocation(),
-             "Assumed rank expression type lowering");
+             "assumed rank expression type lowering");
       for (int dim = 0; dim < rank; ++dim)
         shape.emplace_back(fir::SequenceType::getUnknownExtent());
     }
@@ -328,7 +328,7 @@ struct TypeBuilder {
     if (!ps.empty()) {
       // This type is a PDT (parametric derived type). Create the functions to
       // use for allocation, dereferencing, and address arithmetic here.
-      TODO(loc, "parametrized derived types lowering");
+      TODO(loc, "parameterized derived types lowering");
     }
     LLVM_DEBUG(llvm::dbgs() << "derived type: " << rec << '\n');
 

diff  --git a/flang/lib/Lower/VectorSubscripts.cpp b/flang/lib/Lower/VectorSubscripts.cpp
index 77ddc300d6418..890346f91598e 100644
--- a/flang/lib/Lower/VectorSubscripts.cpp
+++ b/flang/lib/Lower/VectorSubscripts.cpp
@@ -111,7 +111,7 @@ class VectorSubscriptBoxBuilder {
     // Parent components will not be found here, they are not part
     // of the FIR type and cannot be used in the path yet.
     if (componentSymbol.test(Fortran::semantics::Symbol::Flag::ParentComp))
-      TODO(loc, "Reference to parent component");
+      TODO(loc, "reference to parent component");
     mlir::Type fldTy = fir::FieldType::get(&converter.getMLIRContext());
     llvm::StringRef componentName = toStringRef(componentSymbol.name());
     // Parameters threading in field_index is not yet very clear. We only
@@ -212,7 +212,7 @@ class VectorSubscriptBoxBuilder {
 
   mlir::Type gen(const Fortran::evaluate::CoarrayRef &) {
     // Is this possible/legal ?
-    TODO(loc, "Coarray ref with vector subscript in IO input");
+    TODO(loc, "coarray ref with vector subscript in IO input");
   }
 
   template <typename A>

diff  --git a/flang/lib/Optimizer/Builder/MutableBox.cpp b/flang/lib/Optimizer/Builder/MutableBox.cpp
index 6d7eb2952fcdd..95efc8a0b2a21 100644
--- a/flang/lib/Optimizer/Builder/MutableBox.cpp
+++ b/flang/lib/Optimizer/Builder/MutableBox.cpp
@@ -396,7 +396,7 @@ fir::factory::genMutableBoxRead(fir::FirOpBuilder &builder, mlir::Location loc,
                                 const fir::MutableBoxValue &box,
                                 bool mayBePolymorphic) {
   if (box.hasAssumedRank())
-    TODO(loc, "Assumed rank allocatables or pointers");
+    TODO(loc, "assumed rank allocatables or pointers");
   llvm::SmallVector<mlir::Value> lbounds;
   llvm::SmallVector<mlir::Value> extents;
   llvm::SmallVector<mlir::Value> lengths;
@@ -526,7 +526,7 @@ void fir::factory::associateMutableBox(fir::FirOpBuilder &builder,
                             "Cannot write MutableBox to another MutableBox");
       },
       [&](const fir::ProcBoxValue &) {
-        TODO(loc, "Procedure pointer assignment");
+        TODO(loc, "procedure pointer assignment");
       });
 }
 
@@ -623,7 +623,7 @@ void fir::factory::associateMutableBoxWithRemap(
                             "Cannot write MutableBox to another MutableBox");
       },
       [&](const fir::ProcBoxValue &) {
-        TODO(loc, "Procedure pointer assignment");
+        TODO(loc, "procedure pointer assignment");
       });
 }
 

diff  --git a/flang/test/Fir/Todo/allocmem.fir b/flang/test/Fir/Todo/allocmem.fir
index 0ee134b3ebd1d..27509b68195c5 100644
--- a/flang/test/Fir/Todo/allocmem.fir
+++ b/flang/test/Fir/Todo/allocmem.fir
@@ -4,7 +4,7 @@
 // Not implemented yet.
 
 func.func @allocmem_test(%arg0 : i32, %arg1 : i16) {
-// CHECK: not yet implemented fir.allocmem codegen of derived type with length parameters
+// CHECK: not yet implemented: fir.allocmem codegen of derived type with length parameters
   %0 = fir.allocmem !fir.type<_QTt(p1:i32,p2:i16){f1:i32,f2:f32}>(%arg0, %arg1 : i32, i16) {name = "_QEvar"}
   return 
 }

diff  --git a/flang/test/Fir/Todo/coordinate_of_1.fir b/flang/test/Fir/Todo/coordinate_of_1.fir
index 11bbdb3be82f0..6dc90b8cca7ec 100644
--- a/flang/test/Fir/Todo/coordinate_of_1.fir
+++ b/flang/test/Fir/Todo/coordinate_of_1.fir
@@ -5,7 +5,7 @@
 // currently being generated (this error is generated before trying to convert
 // `fir.coordinate_of`)
 func.func @coordinate_box_derived_with_fir_len(%arg0: !fir.box<!fir.type<derived_2{len1:i32}>>) {
-// CHECK: not yet implemented fir.len_param_index codegen
+// CHECK: not yet implemented: fir.len_param_index codegen
   %e = fir.len_param_index len1, !fir.type<derived_2{len1:i32}>
   %q = fir.coordinate_of %arg0, %e : (!fir.box<!fir.type<derived_2{len1:i32}>>, !fir.len) -> !fir.ref<i32>
   return

diff  --git a/flang/test/Fir/Todo/coordinate_of_2.fir b/flang/test/Fir/Todo/coordinate_of_2.fir
index 262db0ff90239..7ceead8de5279 100644
--- a/flang/test/Fir/Todo/coordinate_of_2.fir
+++ b/flang/test/Fir/Todo/coordinate_of_2.fir
@@ -1,6 +1,6 @@
 // RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s
 
-// CHECK: not yet implemented fir.array nested inside other array and/or derived type
+// CHECK: not yet implemented: fir.array nested inside other array and/or derived type
 
 // `!fir.coordinate_of` - `!fir.array` inside "boxed" `!fir.type`
 func.func @coordinate_box_array_inside_derived(%arg0: !fir.box<!fir.type<derived_2{field_1:!fir.array<10 x i32>, field_2:i32}>>, %arg1 : index) {

diff  --git a/flang/test/Fir/Todo/coordinate_of_3.fir b/flang/test/Fir/Todo/coordinate_of_3.fir
index c96e2f293ff12..305422052be27 100644
--- a/flang/test/Fir/Todo/coordinate_of_3.fir
+++ b/flang/test/Fir/Todo/coordinate_of_3.fir
@@ -1,6 +1,6 @@
 // RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s
 
-// CHECK: not yet implemented fir.array nested inside other array and/or derived type
+// CHECK: not yet implemented: fir.array nested inside other array and/or derived type
 
 // `fir.coordinate_of` - `fir.array` inside "boxed" `!fir.type<derived_1{!fir.type<derived_2{}>}` (i.e. nested `!fir.type`)
 func.func @coordinate_box_array_inside_derived(%arg0: !fir.box<!fir.type<derived_1{field_1:!fir.type<derived_2{field_2:!fir.array<10 x i32>}>}>>, %arg1 : index) {

diff  --git a/flang/test/Fir/Todo/coordinate_of_4.fir b/flang/test/Fir/Todo/coordinate_of_4.fir
index 82cc13b3468e6..4593e19c0afb8 100644
--- a/flang/test/Fir/Todo/coordinate_of_4.fir
+++ b/flang/test/Fir/Todo/coordinate_of_4.fir
@@ -4,7 +4,7 @@
 // `!fir.len_param_index` is not implemented yet, the error that we hit is
 // related to `!fir.len_param_index` rather than `!fir.coordinate_of`.
 func.func @coordinate_box_derived_with_fir_len(%arg0: !fir.box<!fir.type<derived_2{len1:i32}>>) {
-// CHECK: not yet implemented fir.len_param_index codegen
+// CHECK: not yet implemented: fir.len_param_index codegen
   %e = fir.len_param_index len1, !fir.type<derived_2{len1:i32}>
   %q = fir.coordinate_of %arg0, %e : (!fir.box<!fir.type<derived_2{len1:i32}>>, !fir.len) -> !fir.ref<i32>
   return

diff  --git a/flang/test/Fir/Todo/dispatch.fir b/flang/test/Fir/Todo/dispatch.fir
index dc96eca24e2d0..e5b90dad9f73b 100644
--- a/flang/test/Fir/Todo/dispatch.fir
+++ b/flang/test/Fir/Todo/dispatch.fir
@@ -4,7 +4,7 @@
 // Not implemented yet.
 
 func.func @dispatch(%arg0: !fir.box<!fir.type<derived3{f:f32}>>) {
-// CHECK: not yet implemented fir.dispatch codegen
+// CHECK: not yet implemented: fir.dispatch codegen
   %0 = fir.dispatch "method"(%arg0) : (!fir.box<!fir.type<derived3{f:f32}>>) -> i32
   return
 }

diff  --git a/flang/test/Fir/Todo/dispatch_table.fir b/flang/test/Fir/Todo/dispatch_table.fir
index e62b2c038a89c..6aa4811e52a6d 100644
--- a/flang/test/Fir/Todo/dispatch_table.fir
+++ b/flang/test/Fir/Todo/dispatch_table.fir
@@ -3,7 +3,7 @@
 // Test fir.dispatch_table conversion to llvm.
 // Not implemented yet.
 
-// CHECK: not yet implemented fir.dispatch_table codegen
+// CHECK: not yet implemented: fir.dispatch_table codegen
 fir.dispatch_table @dispatch_tbl {
   fir.dt_entry "method", @method_impl
 }

diff  --git a/flang/test/Fir/Todo/end.fir b/flang/test/Fir/Todo/end.fir
index b6328925d651f..667e396809b0e 100644
--- a/flang/test/Fir/Todo/end.fir
+++ b/flang/test/Fir/Todo/end.fir
@@ -4,6 +4,6 @@
 // Not implemented yet.
 
 func.func @end_test() {
-// CHECK: not yet implemented fir.end codegen
+// CHECK: not yet implemented: fir.end codegen
   "fir.end"() : () -> ()
 }

diff  --git a/flang/test/Fir/Todo/gentypedesc.fir b/flang/test/Fir/Todo/gentypedesc.fir
index a76aa9a358539..f3a784fd5fde2 100644
--- a/flang/test/Fir/Todo/gentypedesc.fir
+++ b/flang/test/Fir/Todo/gentypedesc.fir
@@ -4,7 +4,7 @@
 // Not implemented yet.
 
 func.func @gentypedesc() {
-// CHECK: not yet implemented fir.gentypedesc codegen
+// CHECK: not yet implemented: fir.gentypedesc codegen
   %0 = fir.gentypedesc !fir.type<derived3>
   return
 }

diff  --git a/flang/test/Fir/Todo/global_len.fir b/flang/test/Fir/Todo/global_len.fir
index 0f4bb61ce1f72..cb3e770dcdd75 100644
--- a/flang/test/Fir/Todo/global_len.fir
+++ b/flang/test/Fir/Todo/global_len.fir
@@ -4,7 +4,7 @@
 // Not implemented yet.
 
 fir.global @global_derived : !fir.type<minez(f:i32)> {
-// CHECK: not yet implemented fir.global_len codegen
+// CHECK: not yet implemented: fir.global_len codegen
   fir.global_len f, 1 : i32
   %0 = fir.undefined !fir.type<minez>
   fir.has_value %0 : !fir.type<minez>

diff  --git a/flang/test/Fir/Todo/len_param_index.fir b/flang/test/Fir/Todo/len_param_index.fir
index 3f7c712ece5ad..016d838afa7e7 100644
--- a/flang/test/Fir/Todo/len_param_index.fir
+++ b/flang/test/Fir/Todo/len_param_index.fir
@@ -4,7 +4,7 @@
 // Not implemented yet.
 
 func.func @lenparamindex() {
-  // CHECK: not yet implemented fir.len_param_index codegen
+  // CHECK: not yet implemented: fir.len_param_index codegen
   %0 = fir.len_param_index l1, !fir.type<twolens(l1:i32, l2:i32){i:i32, f:f32, l:i64}>
   return
 }

diff  --git a/flang/test/Fir/Todo/select_case_with_character.fir b/flang/test/Fir/Todo/select_case_with_character.fir
index c6a8f084fe613..bddcb1e18a1b3 100644
--- a/flang/test/Fir/Todo/select_case_with_character.fir
+++ b/flang/test/Fir/Todo/select_case_with_character.fir
@@ -4,7 +4,7 @@
 // Not implemented yet.
 
 func.func @select_case_charachter(%arg0: !fir.char<2, 10>, %arg1: !fir.char<2, 10>, %arg2: !fir.char<2, 10>) {
-// CHECK: not yet implemented fir.select_case codegen with character type
+// CHECK: not yet implemented: fir.select_case codegen with character type
   fir.select_case %arg0 : !fir.char<2, 10> [#fir.point, %arg1, ^bb1,
                                             #fir.point, %arg2, ^bb2,
                                             unit, ^bb3]

diff  --git a/flang/test/Lower/derived-types.f90 b/flang/test/Lower/derived-types.f90
index 21113876e4ac1..56e4ae5397191 100644
--- a/flang/test/Lower/derived-types.f90
+++ b/flang/test/Lower/derived-types.f90
@@ -1,7 +1,7 @@
 ! Test basic parts of derived type entities lowering
 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
 
-! Note: only testing non parametrized derived type here.
+! Note: only testing non parameterized derived type here.
 
 module d
   type r


        


More information about the flang-commits mailing list