@@ -547,49 +547,35 @@ class IsEqualEvaluateExpr {
547547 template <typename A>
548548 static bool isEqual (const Fortran::evaluate::ImpliedDo<A> &x,
549549 const Fortran::evaluate::ImpliedDo<A> &y) {
550- using Expr = Fortran::evaluate::Expr<A>;
551- for (const auto &[xValue, yValue] : llvm::zip (x.values (), y.values ())) {
552- bool checkValue = Fortran::common::visit (
553- common::visitors{
554- [&](const Expr &v, const Expr &w) { return isEqual (v, w); },
555- [&](const auto &, const auto &) {
556- llvm::report_fatal_error (" isEqual is not handled yet for "
557- " the element type in ImpliedDo" );
558- return false ;
559- },
560- },
561- xValue.u , yValue.u );
562- if (!checkValue) {
563- return false ;
564- }
565- }
566- return isEqual (x.lower (), y.lower ()) && isEqual (x.upper (), y.upper ()) &&
567- isEqual (x.stride (), y.stride ());
550+ return isEqual (x.values (), y.values ()) && isEqual (x.lower (), y.lower ()) &&
551+ isEqual (x.upper (), y.upper ()) && isEqual (x.stride (), y.stride ());
568552 }
569553 template <typename A>
570- static bool isEqual (const Fortran::evaluate::ArrayConstructor<A> &x,
571- const Fortran::evaluate::ArrayConstructor<A> &y) {
554+ static bool isEqual (const Fortran::evaluate::ArrayConstructorValue<A> &x,
555+ const Fortran::evaluate::ArrayConstructorValue<A> &y) {
556+ using Expr = Fortran::evaluate::Expr<A>;
557+ using ImpliedDo = Fortran::evaluate::ImpliedDo<A>;
572558 for (const auto &[xValue, yValue] : llvm::zip (x, y)) {
573- using Expr = Fortran::evaluate::Expr<A>;
574- using ImpliedDo = Fortran::evaluate::ImpliedDo<A>;
575559 bool checkElement = Fortran::common::visit (
576560 common::visitors{
577561 [&](const Expr &v, const Expr &w) { return isEqual (v, w); },
578562 [&](const ImpliedDo &v, const ImpliedDo &w) {
579563 return isEqual (v, w);
580564 },
581- [&](const auto &, const auto &) {
582- llvm::report_fatal_error (" isEqual is not handled yet for "
583- " the element type in ImpliedDo" );
584- return false ;
585- },
565+ [&](const Expr &, const ImpliedDo &) { return false ; },
566+ [&](const ImpliedDo &, const Expr &) { return false ; },
586567 },
587568 xValue.u , yValue.u );
588569 if (!checkElement) {
589570 return false ;
590571 }
591572 }
592- return x.GetType () == y.GetType ();
573+ return true ;
574+ }
575+ template <typename A>
576+ static bool isEqual (const Fortran::evaluate::ArrayConstructor<A> &x,
577+ const Fortran::evaluate::ArrayConstructor<A> &y) {
578+ return isEqual (x, y) && x.GetType () == y.GetType ();
593579 }
594580 static bool isEqual (const Fortran::evaluate::ImpliedDoIndex &x,
595581 const Fortran::evaluate::ImpliedDoIndex &y) {
0 commit comments