Sema: add support for `__attribute__((__swift_error__))`
Introduce a new attribute that is used to indicate the error handling convention used by a function. This is used to translate the error semantics from the decorated interface to a compatible Swift interface. The supported error convention is one of: - none: no error handling - nonnull_error: a non-null error parameter indicates an error signifier - null_result: a return value of NULL is an error signifier - zero_result: a return value of 0 is an error signifier - nonzero_result: a non-zero return value is an error signifier Since this is the first of the attributes needed to support the semantic annotation for Swift, this change also includes the necessary supporting infrastructure for a new category of attributes (Swift). This is based on the work of the original changes in https://github.com/llvm/llvm-project-staging/commit/8afaf3aad2af43cfedca7a24cd817848c4e95c0c Differential Revision: https://reviews.llvm.org/D87331 Reviewed By: John McCall, Aaron Ballman, Dmitri Gribenko
Loading
Please sign in to comment