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

Ivan Zhechev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 25 07:11:53 PDT 2021


ijan1 updated this revision to Diff 368631.
ijan1 added a comment.

Updating to use braced initialisation, removed parentheses in the `return` statement and converted the captures into lambda parameters.


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.368631.patch
Type: text/x-patch
Size: 1325 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210825/1d59935e/attachment.bin>


More information about the llvm-commits mailing list