Files
clang-p2996/clang/test/Analysis/Inputs/system-header-simulator-for-nullability.h
George Karpenkov 2301c5ab4d [analyzer] Trust _Nonnull annotations for system framework
Changes the analyzer to believe that methods annotated with _Nonnull
from system frameworks indeed return non null objects.
Local methods with such annotation are still distrusted.
rdar://24291919

Differential Revision: https://reviews.llvm.org/D44341

llvm-svn: 328282
2018-03-23 00:16:03 +00:00

53 lines
1.1 KiB
Objective-C

#pragma clang system_header
#define nil 0
#define BOOL int
#define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
#define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
NS_ASSUME_NONNULL_BEGIN
typedef struct _NSZone NSZone;
@protocol NSObject
+ (instancetype)alloc;
- (instancetype)init;
- (instancetype)autorelease;
@end
@protocol NSCopying
- (id)copyWithZone:(nullable NSZone *)zone;
@end
@protocol NSMutableCopying
- (id)mutableCopyWithZone:(nullable NSZone *)zone;
@end
__attribute__((objc_root_class))
@interface
NSObject<NSObject>
@end
@interface NSString : NSObject<NSCopying>
- (BOOL)isEqualToString : (NSString *)aString;
- (NSString *)stringByAppendingString:(NSString *)aString;
+ (_Nonnull NSString *) generateString;
+ (_Nullable NSString *) generatePossiblyNullString;
@end
void NSSystemFunctionTakingNonnull(NSString *s);
@interface NSSystemClass : NSObject
- (void) takesNonnull:(NSString *)s;
@end
NSString* _Nullable getPossiblyNullString();
NSString* _Nonnull getString();
@protocol MyProtocol
- (_Nonnull NSString *) getString;
@end
NS_ASSUME_NONNULL_END