[PATCH] D87331: Sema: add support for `__attribute__((__swift_error__))`

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 04:28:12 PDT 2020


gribozavr2 accepted this revision.
gribozavr2 added inline comments.


================
Comment at: clang/include/clang/Basic/AttrDocs.td:3377-3382
+def SwiftDocs : DocumentationCategory<"Controlling Swift Import"> {
+  let Content = [{
+Clang supports additional attributes for controlling how APIs are imported into
+Swift.
+  }];
+}
----------------



================
Comment at: clang/include/clang/Basic/AttrDocs.td:3399
+* ``swift_error(none)`` means that the function should not be imported as
+throwing. The error parameter and result type will be left alone.
+
----------------



================
Comment at: clang/test/SemaObjC/attr-swift-error.m:55
+
+// This is unconventional and very odd but we do process it.
+- (int)q0:(const NSError **)error __attribute__((__swift_error__(nonzero_result)));
----------------



================
Comment at: clang/test/SemaObjC/attr-swift-error.m:97
+
+// This is unconventional and very odd but we do process it.
+extern void *q0(const CFErrorRef *) __attribute__((__swift_error__(null_result)));
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87331



More information about the cfe-commits mailing list