llvm-project/clang/test/AST/attr-swift_private.m
Saleem Abdulrasool 58cdbf518b Sema: add support for __attribute__((__swift_private__))
This attribute allows declarations to be restricted to the framework
itself, enabling Swift to remove the declarations when importing
libraries.  This is useful in the case that the functions can be
implemented in a more natural way for Swift.

This is based on the work of the original changes in
8afaf3aad2

Differential Revision: https://reviews.llvm.org/D87720
Reviewed By: Aaron Ballman
2020-09-25 22:33:53 +00:00

27 lines
626 B
Objective-C

// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
@interface I
- (void)method __attribute__((__swift_private__));
@end
// CHECK: ObjCInterfaceDecl {{.*}} I
// CHECK: ObjCMethodDecl {{.*}} method 'void'
// CHECK: SwiftPrivateAttr
@interface J : I
- (void)method;
@end
// CHECK: ObjCInterfaceDecl {{.*}} J
// CHECK: ObjCMethodDecl {{.*}} method 'void'
// CHECK: SwiftPrivateAttr {{.*}} Inherited
void f(void) __attribute__((__swift_private__));
// CHECK: FunctionDecl {{.*}} f 'void (void)'
// CHECK: SwiftPrivateAttr
void f(void) {
}
// CHECK: FunctionDecl {{.*}} f 'void (void)'
// CHECK: SwiftPrivateAttr {{.*}} Inherited