[PATCH] D108623: [flang] Fix non-deterministic line output function

Ivan Zhechev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 08:14:20 PDT 2021


This revision was automatically updated to reflect the committed changes.
ijan1 marked an inline comment as done.
Closed by commit rGe962718dd5fc: [flang] Fix non-deterministic line output function (authored by ijan1).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108623/new/

https://reviews.llvm.org/D108623

Files:
  flang/lib/Semantics/check-declarations.cpp


Index: flang/lib/Semantics/check-declarations.cpp
===================================================================
--- flang/lib/Semantics/check-declarations.cpp
+++ flang/lib/Semantics/check-declarations.cpp
@@ -1152,6 +1152,12 @@
     return false;
   }
   std::optional<parser::MessageFixedText> msg;
+  auto checkDefinedOperatorArgs{
+      [&](SourceName opName, const Symbol &specific, const Procedure &proc) {
+        bool arg0Defined{CheckDefinedOperatorArg(opName, specific, proc, 0)};
+        bool arg1Defined{CheckDefinedOperatorArg(opName, specific, proc, 1)};
+        return arg0Defined && arg1Defined;
+      }};
   if (specific.attrs().test(Attr::NOPASS)) { // C774
     msg = "%s procedure '%s' may not have NOPASS attribute"_err_en_US;
   } else if (!proc.functionResult.has_value()) {
@@ -1161,8 +1167,7 @@
           " result"_err_en_US;
   } else if (auto m{CheckNumberOfArgs(kind, proc.dummyArguments.size())}) {
     msg = std::move(m);
-  } else if (!CheckDefinedOperatorArg(opName, specific, proc, 0) |
-      !CheckDefinedOperatorArg(opName, specific, proc, 1)) {
+  } else if (!checkDefinedOperatorArgs(opName, specific, proc)) {
     return false; // error was reported
   } else if (ConflictsWithIntrinsicOperator(kind, proc)) {
     msg = "%s function '%s' conflicts with intrinsic operator"_err_en_US;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108623.370278.patch
Type: text/x-patch
Size: 1338 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210902/a1b431db/attachment.bin>


More information about the llvm-commits mailing list