mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 02:16:05 +00:00

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
27 lines
626 B
Objective-C
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
|