[clang] [APINotes] Add SWIFT_RETURNS_(UN)RETAINED support to APINotes (PR #118938)

Egor Zhdan via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 08:30:27 PST 2024


================
@@ -511,6 +511,10 @@ static void ProcessAPINotes(Sema &S, FunctionOrMethod AnyFunc,
       AnyTypeChanged = true;
   }
 
+  // returns_(un)retained
+  if (!Info.SwiftReturnOwnership.empty())
+    D->addAttr(SwiftAttrAttr::Create(S.Context, Info.SwiftReturnOwnership));
----------------
egorzhdan wrote:

I think we would want to construct a string `"returns_" + Info.SwiftReturnOwnership` here.

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


More information about the cfe-commits mailing list