[flang-commits] [flang] df209b8 - [flang] Make not yet implemented messages more consistent

Peter Steinfeld via flang-commits flang-commits at lists.llvm.org
Thu Mar 24 15:21:58 PDT 2022


Author: Peter Steinfeld
Date: 2022-03-24T15:19:40-07:00
New Revision: df209b8038f3803621e96799f5c43e9145448e10

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

LOG: [flang] Make not yet implemented messages more consistent

To make it easier to find things that are not yet implemented, I'm changing the
messages that appear in the compiler's output to all have the string "not yet
implemented:".

These changes apply to files in the front end.  I have another set of changes
to files in the lowering code.

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

Added: 
    

Modified: 
    flang/lib/Semantics/expression.cpp
    flang/lib/Semantics/resolve-names.cpp
    flang/runtime/edit-output.cpp
    flang/test/Semantics/struct01.f90

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/expression.cpp b/flang/lib/Semantics/expression.cpp
index 3bd87b6715ba1..fcfe98ef90ac6 100644
--- a/flang/lib/Semantics/expression.cpp
+++ b/flang/lib/Semantics/expression.cpp
@@ -1835,7 +1835,7 @@ static std::optional<parser::CharBlock> GetPassName(
 static int GetPassIndex(const Symbol &proc) {
   CHECK(!proc.attrs().test(semantics::Attr::NOPASS));
   std::optional<parser::CharBlock> passName{GetPassName(proc)};
-  const auto *interface{semantics::FindInterface(proc)};
+  const auto *interface { semantics::FindInterface(proc) };
   if (!passName || !interface) {
     return 0; // first argument is passed-object
   }
@@ -3215,26 +3215,28 @@ void ArgumentAnalyzer::Analyze(
   // be detected and represented (they're not expressions).
   // TODO: C1534: Don't allow a "restricted" specific intrinsic to be passed.
   std::optional<ActualArgument> actual;
-  std::visit(common::visitors{
-                 [&](const common::Indirection<parser::Expr> &x) {
-                   actual = AnalyzeExpr(x.value());
-                   SetArgSourceLocation(actual, x.value().source);
-                 },
-                 [&](const parser::AltReturnSpec &label) {
-                   if (!isSubroutine) {
-                     context_.Say(
-                         "alternate return specification may not appear on"
-                         " function reference"_err_en_US);
-                   }
-                   actual = ActualArgument(label.v);
-                 },
-                 [&](const parser::ActualArg::PercentRef &) {
-                   context_.Say("TODO: %REF() argument"_err_en_US);
-                 },
-                 [&](const parser::ActualArg::PercentVal &) {
-                   context_.Say("TODO: %VAL() argument"_err_en_US);
-                 },
-             },
+  std::visit(
+      common::visitors{
+          [&](const common::Indirection<parser::Expr> &x) {
+            actual = AnalyzeExpr(x.value());
+            SetArgSourceLocation(actual, x.value().source);
+          },
+          [&](const parser::AltReturnSpec &label) {
+            if (!isSubroutine) {
+              context_.Say("alternate return specification may not appear on"
+                           " function reference"_err_en_US);
+            }
+            actual = ActualArgument(label.v);
+          },
+          [&](const parser::ActualArg::PercentRef &) {
+            context_.Say(
+                "not yet implemented: %REF() intrinsic for arguments"_err_en_US);
+          },
+          [&](const parser::ActualArg::PercentVal &) {
+            context_.Say(
+                "not yet implemetned: %VAL() intrinsic for arguments"_err_en_US);
+          },
+      },
       std::get<parser::ActualArg>(arg.t).u);
   if (actual) {
     if (const auto &argKW{std::get<std::optional<parser::Keyword>>(arg.t)}) {

diff  --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index 650debbc11b6c..cf7bebcfd656b 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -4721,7 +4721,7 @@ bool DeclarationVisitor::Pre(const parser::StructureDef &def) {
 }
 
 bool DeclarationVisitor::Pre(const parser::Union::UnionStmt &) {
-  Say("UNION is not yet supported"_err_en_US); // TODO
+  Say("not yet implemented: support for UNION"_err_en_US); // TODO
   return true;
 }
 

diff  --git a/flang/runtime/edit-output.cpp b/flang/runtime/edit-output.cpp
index e3bb5abb2bb98..ebf2917acffb4 100644
--- a/flang/runtime/edit-output.cpp
+++ b/flang/runtime/edit-output.cpp
@@ -411,7 +411,7 @@ bool RealOutputEditing<binaryPrecision>::EditListDirectedOutput(
 template <int binaryPrecision>
 bool RealOutputEditing<binaryPrecision>::EditEXOutput(const DataEdit &) {
   io_.GetIoErrorHandler().Crash(
-      "EX output editing is not yet implemented"); // TODO
+      "not yet implemented: EX output editing"); // TODO
 }
 
 template <int KIND> bool RealOutputEditing<KIND>::Edit(const DataEdit &edit) {

diff  --git a/flang/test/Semantics/struct01.f90 b/flang/test/Semantics/struct01.f90
index 85d1159ba1dbb..22efe08d796ac 100644
--- a/flang/test/Semantics/struct01.f90
+++ b/flang/test/Semantics/struct01.f90
@@ -6,7 +6,7 @@ program main
   structure /s/
     !ERROR: /s/ is not a known STRUCTURE
     record /s/ attemptToRecurse
-    !ERROR: UNION is not yet supported
+    !ERROR: not yet implemented: support for UNION
     union
       map
         integer j


        


More information about the flang-commits mailing list