================
@@ -653,15 +653,26 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
       OS << getModRefStr(OtherMR);
     }
 
+    bool TargetPrintedForAll = false;
     for (auto Loc : MemoryEffects::locations()) {
       ModRefInfo MR = ME.getModRef(Loc);
       if (MR == OtherMR)
         continue;
 
-      if (!First)
+      if (!First && !TargetPrintedForAll)
         OS << ", ";
       First = false;
 
+      if (ME.isTargetMemLoc(Loc) && ME.isTargetMemLocSameForAll()) {
----------------
nikic wrote:

Yes, exactly. In practice, the common case would probably be something like 
`memory(..., target_mem: none, target_memN: readwrite)`, where only one target 
memory location is set.

https://github.com/llvm/llvm-project/pull/176968
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to