[PATCH] D91440: [flang] Fix "EQ" comparison of arrays

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 10:00:39 PST 2020


klausler accepted this revision.
klausler added inline comments.
This revision is now accepted and ready to land.


================
Comment at: flang/lib/Evaluate/shape.cpp:706
             }
+          } else { // Couldn't get the right extent
+            return false;
----------------
Might be more readable if restructured.  Two possible ways:

for (int j{0}; j < n; ++j) {
  auto leftDim{...}, rightDim{...};
  if (!leftDim || !rightDim) { return false; }
  if (*leftDim != *rightDim) { Say(...); return false; }
}

or

for (int j{0}; j < n; ++j) {
  if (auto leftDim{...}) {
    if (auto rightDim{...}) {
      if (*leftDim == *rightDim) {
        continue;
      }
      Say(...);
    }
  }
  return false;
}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91440



More information about the llvm-commits mailing list