================
@@ -8025,6 +8025,19 @@ class MappableExprsHandler {
       MapCombinedInfoTy StructBaseCurInfo;
       const Decl *D = Data.first;
       const ValueDecl *VD = cast_or_null<ValueDecl>(D);
+      bool HasMapBasePtr = false;
+      bool HasMapArraySec = false;
+      for (const auto &M : Data.second) {
+        for (const MapInfo &L : M) {
+          const Expr *E = L.VarRef;
+          if (VD && VD->getType()->isAnyPointerType() &&
+              isa_and_present<DeclRefExpr>(E))
+            HasMapBasePtr = true;
+          if (VD && VD->getType()->isAnyPointerType() &&
+              isa_and_present<ArraySectionExpr, ArraySubscriptExpr>(E))
+            HasMapArraySec = true;
+        }
----------------
alexey-bataev wrote:

```suggestion
  HasMapBasePtr = any_of(M, [](const MapInfo &L) { return 
isa_and_present<DeclRefExpr>(L.VarRef); });
    HasMapArraySec = any_of(M, [](const MapInfo &L) { return 
isa_and_present<ArraySectionExpr, ArraySubscriptExpr>(L.VarRef); });
  if (HasMapBasePtr && HasMapArraySec)
    break;
```

https://github.com/llvm/llvm-project/pull/94802
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to