[all-commits] [llvm/llvm-project] f5ab5b: Sema: add support for `__attribute__((__swift_erro...

Saleem Abdulrasool via All-commits all-commits at lists.llvm.org
Fri Sep 11 14:21:26 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f5ab5b20fb2aae5567e6c50cc642ff63eb2146d4
      https://github.com/llvm/llvm-project/commit/f5ab5b20fb2aae5567e6c50cc642ff63eb2146d4
  Author: Saleem Abdulrasool <compnerd at compnerd.org>
  Date:   2020-09-11 (Fri, 11 Sep 2020)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/AttrDocs.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/test/Misc/pragma-attribute-supported-attributes-list.test
    A clang/test/SemaObjC/attr-swift-error.m

  Log Message:
  -----------
  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




More information about the All-commits mailing list