[PATCH] D95228: Add swift_async_context parameter attribute mapping to IR equivalent

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 22 12:58:59 PST 2021


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM with a documentation question and a testing request.



================
Comment at: clang/include/clang/Basic/AttrDocs.td:4404
+
+A context parameter must have pointer or reference type.
+  }];
----------------
Should we specify whether pointer to members or ObjC object pointers are fine (given that those are both somewhat "odd" pointer types)? Function pointers?

(We may want to clarify this in the other docs in a follow-up if we think this is unclear.)


================
Comment at: clang/test/Sema/attr-swiftcall.c:34
+
+void async_context_okay_for_now(ASYNC_CONTEXT void *context);
+void async_context_bad_type(ASYNC_CONTEXT int context) SWIFTCALL; // expected-error {{'swift_async_context' parameter must have pointer type; type here is 'int'}}
----------------
Can you also add tests that show the attribute doesn't accept any arguments and will error when written on the wrong subject (like a function rather than a parameter)?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95228/new/

https://reviews.llvm.org/D95228



More information about the cfe-commits mailing list