================
@@ -94,6 +94,25 @@ class LifetimeAnnotatedOriginTypeCollector
         CollectedTypes.push_back(RetType);
         return;
       }
+      if (auto *Attr = Param->getAttr<LifetimeCaptureByAttr>()) {
+        for (int Idx : Attr->params()) {
+          if (Idx == LifetimeCaptureByAttr::Global ||
+              Idx == LifetimeCaptureByAttr::Unknown ||
+              Idx == LifetimeCaptureByAttr::Invalid)
+            continue;
+          if (Idx == LifetimeCaptureByAttr::This) {
+            if (MD && MD->isInstance())
+              CollectedTypes.push_back(MD->getFunctionObjectParameterType());
+          } else if (int LogicalIdx =
+                         Idx -
----------------
Xazax-hun wrote:

Nit: this formatting does not look great, I wonder if hoisting part of the 
expression into a bool or int might make this more reasonable.  

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

Reply via email to