[clang] [clang][APINotes] Add support for the SwiftEscapable attribute (PR #115866)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 09:17:04 PST 2024


================
@@ -647,6 +647,13 @@ static void ProcessAPINotes(Sema &S, TagDecl *D, const api_notes::TagInfo &Info,
       D->addAttr(SwiftAttrAttr::Create(S.Context, "~Copyable"));
   }
 
+  if (auto Escapable = Info.isSwiftEscapable()) {
+    if (*Escapable)
+      D->addAttr(SwiftAttrAttr::Create(S.Context, "Escapable"));
+    else
+      D->addAttr(SwiftAttrAttr::Create(S.Context, "~Escapable"));
+  }
----------------
compnerd wrote:

```suggestion
  if (auto Escapable = Info.isSwiftEscapable())
    D->addAttr(SwiftAttrAttr::Create(S.Context, *Escapable ? "Escapable" : "~Escapable"));
```

https://github.com/llvm/llvm-project/pull/115866


More information about the cfe-commits mailing list