From 66a34a6a45019a54d84e9c5a06c4498e56f13a40 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 12 Sep 2012 01:11:10 +0000 Subject: Adjust some analyzer tests to place widely shared inputs inside of an 'Inputs' subdirectory. The general desire has been to have essentially all of the non-test input files live in such directories, with some exceptions for obvious and common patterns like 'foo.c' using 'foo.h'. This came up because our distributed test runner couldn't find some of the headers, for example with stl.cpp. No functionality changed, just shuffling around here. llvm-svn: 163674 --- .../Analysis/Inputs/system-header-simulator-cxx.h | 57 +++++++++ .../Analysis/Inputs/system-header-simulator-objc.h | 130 +++++++++++++++++++++ .../test/Analysis/Inputs/system-header-simulator.h | 62 ++++++++++ clang/test/Analysis/coverage.c | 2 +- clang/test/Analysis/global-region-invalidation.c | 2 +- clang/test/Analysis/inlining/stl.cpp | 2 +- clang/test/Analysis/malloc-interprocedural.c | 2 +- clang/test/Analysis/malloc.c | 2 +- clang/test/Analysis/malloc.m | 2 +- clang/test/Analysis/malloc.mm | 4 +- clang/test/Analysis/system-header-simulator-cxx.h | 57 --------- clang/test/Analysis/system-header-simulator-objc.h | 130 --------------------- clang/test/Analysis/system-header-simulator.h | 62 ---------- 13 files changed, 257 insertions(+), 257 deletions(-) create mode 100644 clang/test/Analysis/Inputs/system-header-simulator-cxx.h create mode 100644 clang/test/Analysis/Inputs/system-header-simulator-objc.h create mode 100644 clang/test/Analysis/Inputs/system-header-simulator.h delete mode 100644 clang/test/Analysis/system-header-simulator-cxx.h delete mode 100644 clang/test/Analysis/system-header-simulator-objc.h delete mode 100644 clang/test/Analysis/system-header-simulator.h (limited to 'clang') diff --git a/clang/test/Analysis/Inputs/system-header-simulator-cxx.h b/clang/test/Analysis/Inputs/system-header-simulator-cxx.h new file mode 100644 index 00000000000..e762d0a1bdf --- /dev/null +++ b/clang/test/Analysis/Inputs/system-header-simulator-cxx.h @@ -0,0 +1,57 @@ +#pragma clang system_header + +namespace std { + template + struct pair { + T1 first; + T2 second; + + pair() : first(), second() {} + pair(const T1 &a, const T2 &b) : first(a), second(b) {} + + template + pair(const pair &other) : first(other.first), second(other.second) {} + }; + + typedef __typeof__(sizeof(int)) size_t; + + template + class vector { + T *_start; + T *_finish; + T *_end_of_storage; + public: + vector() : _start(0), _finish(0), _end_of_storage(0) {} + ~vector(); + + size_t size() const { + return size_t(_finish - _start); + } + + void push_back(); + T pop_back(); + + T &operator[](size_t n) { + return _start[n]; + } + + const T &operator[](size_t n) const { + return _start[n]; + } + + T *begin() { return _start; } + const T *begin() const { return _start; } + + T *end() { return _finish; } + const T *end() const { return _finish; } + }; + + class exception { + public: + exception() throw(); + virtual ~exception() throw(); + virtual const char *what() const throw() { + return 0; + } + }; +} diff --git a/clang/test/Analysis/Inputs/system-header-simulator-objc.h b/clang/test/Analysis/Inputs/system-header-simulator-objc.h new file mode 100644 index 00000000000..a647b374040 --- /dev/null +++ b/clang/test/Analysis/Inputs/system-header-simulator-objc.h @@ -0,0 +1,130 @@ +#pragma clang system_header + +typedef unsigned int UInt32; +typedef unsigned short UInt16; + +typedef signed long CFIndex; +typedef signed char BOOL; +typedef unsigned long NSUInteger; +typedef unsigned short unichar; +typedef UInt16 UniChar; + +enum { + NSASCIIStringEncoding = 1, + NSNEXTSTEPStringEncoding = 2, + NSJapaneseEUCStringEncoding = 3, + NSUTF8StringEncoding = 4, + NSISOLatin1StringEncoding = 5, + NSSymbolStringEncoding = 6, + NSNonLossyASCIIStringEncoding = 7, +}; +typedef const struct __CFString * CFStringRef; +typedef struct __CFString * CFMutableStringRef; +typedef NSUInteger NSStringEncoding; +typedef UInt32 CFStringEncoding; + +typedef const void * CFTypeRef; + +typedef const struct __CFAllocator * CFAllocatorRef; +extern const CFAllocatorRef kCFAllocatorDefault; +extern const CFAllocatorRef kCFAllocatorSystemDefault; +extern const CFAllocatorRef kCFAllocatorMalloc; +extern const CFAllocatorRef kCFAllocatorMallocZone; +extern const CFAllocatorRef kCFAllocatorNull; + +@class NSString, Protocol; +extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); +typedef struct _NSZone NSZone; +@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; +@protocol NSObject +- (BOOL)isEqual:(id)object; +- (id)retain; +- (id)copy; +- (oneway void)release; +- (id)autorelease; +- (id)init; +@end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone; +@end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; +@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; +@end +@interface NSObject {} ++ (id)allocWithZone:(NSZone *)zone; ++ (id)alloc; +- (void)dealloc; +@end +@interface NSObject (NSCoderMethods) +- (id)awakeAfterUsingCoder:(NSCoder *)aDecoder; +@end +extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); +typedef struct { +} +NSFastEnumerationState; +@protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; +@end @class NSString, NSDictionary; +@interface NSValue : NSObject - (void)getValue:(void *)value; +@end @interface NSNumber : NSValue - (char)charValue; +- (id)initWithInt:(int)value; +@end @class NSString; +@interface NSArray : NSObject - (NSUInteger)count; +@end @interface NSArray (NSArrayCreation) + (id)array; +@end @interface NSAutoreleasePool : NSObject { +} +- (void)drain; +@end extern NSString * const NSBundleDidLoadNotification; +typedef double NSTimeInterval; +@interface NSDate : NSObject - (NSTimeInterval)timeIntervalSinceReferenceDate; +@end + +@interface NSString : NSObject +- (NSUInteger)length; +- (NSString *)stringByAppendingString:(NSString *)aString; +- ( const char *)UTF8String; +- (id)initWithUTF8String:(const char *)nullTerminatedCString; +- (id)initWithCharactersNoCopy:(unichar *)characters length:(NSUInteger)length freeWhenDone:(BOOL)freeBuffer; +- (id)initWithCharacters:(const unichar *)characters length:(NSUInteger)length; +- (id)initWithBytes:(const void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding; +- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding freeWhenDone:(BOOL)freeBuffer; ++ (id)stringWithUTF8String:(const char *)nullTerminatedCString; ++ (id)stringWithString:(NSString *)string; +@end @class NSString, NSURL, NSError; + +@interface NSMutableString : NSString +- (void)appendFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2))); +@end + +@interface NSData : NSObject - (NSUInteger)length; ++ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length; ++ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b; +- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length; +- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b; +@end + +typedef struct { +} +CFDictionaryKeyCallBacks; +extern const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks; +typedef struct { +} +CFDictionaryValueCallBacks; +extern const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks; +typedef const struct __CFDictionary * CFDictionaryRef; +typedef struct __CFDictionary * CFMutableDictionaryRef; +extern CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks); +void CFDictionarySetValue(CFMutableDictionaryRef, const void *, const void *); + + +extern void CFRelease(CFTypeRef cf); + +extern CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc, UniChar *chars, CFIndex numChars, CFIndex capacity, CFAllocatorRef externalCharactersAllocator); +extern CFStringRef CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator); +extern void CFStringAppend(CFMutableStringRef theString, CFStringRef appendedString); + +void SystemHeaderFunctionWithBlockParam(void *, void (^block)(void *), unsigned); + +@interface NSPointerArray : NSObject +- (void)addPointer:(void *)pointer; +- (void)insertPointer:(void *)item atIndex:(NSUInteger)index; +- (void)replacePointerAtIndex:(NSUInteger)index withPointer:(void *)item; +- (void *)pointerAtIndex:(NSUInteger)index; +@end + diff --git a/clang/test/Analysis/Inputs/system-header-simulator.h b/clang/test/Analysis/Inputs/system-header-simulator.h new file mode 100644 index 00000000000..5790fb9cff4 --- /dev/null +++ b/clang/test/Analysis/Inputs/system-header-simulator.h @@ -0,0 +1,62 @@ +#pragma clang system_header + +typedef struct _FILE FILE; +extern FILE *stdin; +extern FILE *stdout; +extern FILE *stderr; +// Include a variant of standard streams that occur in the pre-processed file. +extern FILE *__stdinp; +extern FILE *__stdoutp; +extern FILE *__stderrp; + + +int fscanf(FILE *restrict, const char *restrict, ...); + +// Note, on some platforms errno macro gets replaced with a function call. +extern int errno; + +unsigned long strlen(const char *); + +char *strcpy(char *restrict, const char *restrict); + +typedef unsigned long __darwin_pthread_key_t; +typedef __darwin_pthread_key_t pthread_key_t; +int pthread_setspecific(pthread_key_t, const void *); + +typedef long long __int64_t; +typedef __int64_t __darwin_off_t; +typedef __darwin_off_t fpos_t; + +void setbuf(FILE * restrict, char * restrict); +int setvbuf(FILE * restrict, char * restrict, int, size_t); + +FILE *funopen(const void *, + int (*)(void *, char *, int), + int (*)(void *, const char *, int), + fpos_t (*)(void *, fpos_t, int), + int (*)(void *)); + +int sqlite3_bind_text_my(int, const char*, int n, void(*)(void*)); + +typedef void (*freeCallback) (void*); +typedef struct { + int i; + freeCallback fc; +} StWithCallback; + +int dealocateMemWhenDoneByVal(void*, StWithCallback); +int dealocateMemWhenDoneByRef(StWithCallback*, const void*); + +typedef struct CGContext *CGContextRef; +CGContextRef CGBitmapContextCreate(void *data/*, size_t width, size_t height, + size_t bitsPerComponent, size_t bytesPerRow, + CGColorSpaceRef space, + CGBitmapInfo bitmapInfo*/); +void *CGBitmapContextGetData(CGContextRef context); + +// Include xpc. +typedef struct _xpc_connection_s * xpc_connection_t; +typedef void (*xpc_finalizer_t)(void *value); +void xpc_connection_set_context(xpc_connection_t connection, void *context); +void xpc_connection_set_finalizer_f(xpc_connection_t connection, xpc_finalizer_t finalizer); +void xpc_connection_resume(xpc_connection_t connection); diff --git a/clang/test/Analysis/coverage.c b/clang/test/Analysis/coverage.c index 811691391eb..66f0a5e385b 100644 --- a/clang/test/Analysis/coverage.c +++ b/clang/test/Analysis/coverage.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -analyzer-max-loop 4 -verify %s -#include "system-header-simulator.h" +#include "Inputs/system-header-simulator.h" typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); diff --git a/clang/test/Analysis/global-region-invalidation.c b/clang/test/Analysis/global-region-invalidation.c index ee6b55c7960..2d64b49a8ba 100644 --- a/clang/test/Analysis/global-region-invalidation.c +++ b/clang/test/Analysis/global-region-invalidation.c @@ -3,7 +3,7 @@ void clang_analyzer_eval(int); // Note, we do need to include headers here, since the analyzer checks if the function declaration is located in a system header. -#include "system-header-simulator.h" +#include "Inputs/system-header-simulator.h" // Test that system header does not invalidate the internal global. int size_rdar9373039 = 1; diff --git a/clang/test/Analysis/inlining/stl.cpp b/clang/test/Analysis/inlining/stl.cpp index 56670a0f16d..cec782151c9 100644 --- a/clang/test/Analysis/inlining/stl.cpp +++ b/clang/test/Analysis/inlining/stl.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-ipa=dynamic -analyzer-config c++-stdlib-inlining=false -verify %s // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-ipa=dynamic -analyzer-config c++-stdlib-inlining=true -DINLINE=1 -verify %s -#include "../system-header-simulator-cxx.h" +#include "../Inputs/system-header-simulator-cxx.h" void clang_analyzer_eval(bool); diff --git a/clang/test/Analysis/malloc-interprocedural.c b/clang/test/Analysis/malloc-interprocedural.c index c804219eb4d..0ab3a715585 100644 --- a/clang/test/Analysis/malloc-interprocedural.c +++ b/clang/test/Analysis/malloc-interprocedural.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc -analyzer-inline-max-stack-depth=5 -analyzer-inline-max-function-size=6 -verify %s -#include "system-header-simulator.h" +#include "Inputs/system-header-simulator.h" typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); diff --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c index fe99fa10d68..52a79243ce4 100644 --- a/clang/test/Analysis/malloc.c +++ b/clang/test/Analysis/malloc.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify %s -#include "system-header-simulator.h" +#include "Inputs/system-header-simulator.h" void clang_analyzer_eval(int); diff --git a/clang/test/Analysis/malloc.m b/clang/test/Analysis/malloc.m index 08206f3bf14..21d2dafa38b 100644 --- a/clang/test/Analysis/malloc.m +++ b/clang/test/Analysis/malloc.m @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -Wno-objc-root-class -fblocks %s -#include "system-header-simulator-objc.h" +#include "Inputs/system-header-simulator-objc.h" @class NSString; typedef __typeof(sizeof(int)) size_t; diff --git a/clang/test/Analysis/malloc.mm b/clang/test/Analysis/malloc.mm index 7a9d881b151..b5a1aeb12b8 100644 --- a/clang/test/Analysis/malloc.mm +++ b/clang/test/Analysis/malloc.mm @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -fblocks %s -#include "system-header-simulator-objc.h" +#include "Inputs/system-header-simulator-objc.h" typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); @@ -221,4 +221,4 @@ void foo(NSPointerArray* pointerArray) { void noCrashOnVariableArgumentSelector() { NSMutableString *myString = [NSMutableString stringWithString:@"some text"]; [myString appendFormat:@"some text = %d", 3]; -} \ No newline at end of file +} diff --git a/clang/test/Analysis/system-header-simulator-cxx.h b/clang/test/Analysis/system-header-simulator-cxx.h deleted file mode 100644 index e762d0a1bdf..00000000000 --- a/clang/test/Analysis/system-header-simulator-cxx.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma clang system_header - -namespace std { - template - struct pair { - T1 first; - T2 second; - - pair() : first(), second() {} - pair(const T1 &a, const T2 &b) : first(a), second(b) {} - - template - pair(const pair &other) : first(other.first), second(other.second) {} - }; - - typedef __typeof__(sizeof(int)) size_t; - - template - class vector { - T *_start; - T *_finish; - T *_end_of_storage; - public: - vector() : _start(0), _finish(0), _end_of_storage(0) {} - ~vector(); - - size_t size() const { - return size_t(_finish - _start); - } - - void push_back(); - T pop_back(); - - T &operator[](size_t n) { - return _start[n]; - } - - const T &operator[](size_t n) const { - return _start[n]; - } - - T *begin() { return _start; } - const T *begin() const { return _start; } - - T *end() { return _finish; } - const T *end() const { return _finish; } - }; - - class exception { - public: - exception() throw(); - virtual ~exception() throw(); - virtual const char *what() const throw() { - return 0; - } - }; -} diff --git a/clang/test/Analysis/system-header-simulator-objc.h b/clang/test/Analysis/system-header-simulator-objc.h deleted file mode 100644 index a647b374040..00000000000 --- a/clang/test/Analysis/system-header-simulator-objc.h +++ /dev/null @@ -1,130 +0,0 @@ -#pragma clang system_header - -typedef unsigned int UInt32; -typedef unsigned short UInt16; - -typedef signed long CFIndex; -typedef signed char BOOL; -typedef unsigned long NSUInteger; -typedef unsigned short unichar; -typedef UInt16 UniChar; - -enum { - NSASCIIStringEncoding = 1, - NSNEXTSTEPStringEncoding = 2, - NSJapaneseEUCStringEncoding = 3, - NSUTF8StringEncoding = 4, - NSISOLatin1StringEncoding = 5, - NSSymbolStringEncoding = 6, - NSNonLossyASCIIStringEncoding = 7, -}; -typedef const struct __CFString * CFStringRef; -typedef struct __CFString * CFMutableStringRef; -typedef NSUInteger NSStringEncoding; -typedef UInt32 CFStringEncoding; - -typedef const void * CFTypeRef; - -typedef const struct __CFAllocator * CFAllocatorRef; -extern const CFAllocatorRef kCFAllocatorDefault; -extern const CFAllocatorRef kCFAllocatorSystemDefault; -extern const CFAllocatorRef kCFAllocatorMalloc; -extern const CFAllocatorRef kCFAllocatorMallocZone; -extern const CFAllocatorRef kCFAllocatorNull; - -@class NSString, Protocol; -extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); -typedef struct _NSZone NSZone; -@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; -@protocol NSObject -- (BOOL)isEqual:(id)object; -- (id)retain; -- (id)copy; -- (oneway void)release; -- (id)autorelease; -- (id)init; -@end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone; -@end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; -@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; -@end -@interface NSObject {} -+ (id)allocWithZone:(NSZone *)zone; -+ (id)alloc; -- (void)dealloc; -@end -@interface NSObject (NSCoderMethods) -- (id)awakeAfterUsingCoder:(NSCoder *)aDecoder; -@end -extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); -typedef struct { -} -NSFastEnumerationState; -@protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; -@end @class NSString, NSDictionary; -@interface NSValue : NSObject - (void)getValue:(void *)value; -@end @interface NSNumber : NSValue - (char)charValue; -- (id)initWithInt:(int)value; -@end @class NSString; -@interface NSArray : NSObject - (NSUInteger)count; -@end @interface NSArray (NSArrayCreation) + (id)array; -@end @interface NSAutoreleasePool : NSObject { -} -- (void)drain; -@end extern NSString * const NSBundleDidLoadNotification; -typedef double NSTimeInterval; -@interface NSDate : NSObject - (NSTimeInterval)timeIntervalSinceReferenceDate; -@end - -@interface NSString : NSObject -- (NSUInteger)length; -- (NSString *)stringByAppendingString:(NSString *)aString; -- ( const char *)UTF8String; -- (id)initWithUTF8String:(const char *)nullTerminatedCString; -- (id)initWithCharactersNoCopy:(unichar *)characters length:(NSUInteger)length freeWhenDone:(BOOL)freeBuffer; -- (id)initWithCharacters:(const unichar *)characters length:(NSUInteger)length; -- (id)initWithBytes:(const void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding; -- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding freeWhenDone:(BOOL)freeBuffer; -+ (id)stringWithUTF8String:(const char *)nullTerminatedCString; -+ (id)stringWithString:(NSString *)string; -@end @class NSString, NSURL, NSError; - -@interface NSMutableString : NSString -- (void)appendFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2))); -@end - -@interface NSData : NSObject - (NSUInteger)length; -+ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length; -+ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b; -- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length; -- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b; -@end - -typedef struct { -} -CFDictionaryKeyCallBacks; -extern const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks; -typedef struct { -} -CFDictionaryValueCallBacks; -extern const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks; -typedef const struct __CFDictionary * CFDictionaryRef; -typedef struct __CFDictionary * CFMutableDictionaryRef; -extern CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks); -void CFDictionarySetValue(CFMutableDictionaryRef, const void *, const void *); - - -extern void CFRelease(CFTypeRef cf); - -extern CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc, UniChar *chars, CFIndex numChars, CFIndex capacity, CFAllocatorRef externalCharactersAllocator); -extern CFStringRef CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator); -extern void CFStringAppend(CFMutableStringRef theString, CFStringRef appendedString); - -void SystemHeaderFunctionWithBlockParam(void *, void (^block)(void *), unsigned); - -@interface NSPointerArray : NSObject -- (void)addPointer:(void *)pointer; -- (void)insertPointer:(void *)item atIndex:(NSUInteger)index; -- (void)replacePointerAtIndex:(NSUInteger)index withPointer:(void *)item; -- (void *)pointerAtIndex:(NSUInteger)index; -@end - diff --git a/clang/test/Analysis/system-header-simulator.h b/clang/test/Analysis/system-header-simulator.h deleted file mode 100644 index 5790fb9cff4..00000000000 --- a/clang/test/Analysis/system-header-simulator.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma clang system_header - -typedef struct _FILE FILE; -extern FILE *stdin; -extern FILE *stdout; -extern FILE *stderr; -// Include a variant of standard streams that occur in the pre-processed file. -extern FILE *__stdinp; -extern FILE *__stdoutp; -extern FILE *__stderrp; - - -int fscanf(FILE *restrict, const char *restrict, ...); - -// Note, on some platforms errno macro gets replaced with a function call. -extern int errno; - -unsigned long strlen(const char *); - -char *strcpy(char *restrict, const char *restrict); - -typedef unsigned long __darwin_pthread_key_t; -typedef __darwin_pthread_key_t pthread_key_t; -int pthread_setspecific(pthread_key_t, const void *); - -typedef long long __int64_t; -typedef __int64_t __darwin_off_t; -typedef __darwin_off_t fpos_t; - -void setbuf(FILE * restrict, char * restrict); -int setvbuf(FILE * restrict, char * restrict, int, size_t); - -FILE *funopen(const void *, - int (*)(void *, char *, int), - int (*)(void *, const char *, int), - fpos_t (*)(void *, fpos_t, int), - int (*)(void *)); - -int sqlite3_bind_text_my(int, const char*, int n, void(*)(void*)); - -typedef void (*freeCallback) (void*); -typedef struct { - int i; - freeCallback fc; -} StWithCallback; - -int dealocateMemWhenDoneByVal(void*, StWithCallback); -int dealocateMemWhenDoneByRef(StWithCallback*, const void*); - -typedef struct CGContext *CGContextRef; -CGContextRef CGBitmapContextCreate(void *data/*, size_t width, size_t height, - size_t bitsPerComponent, size_t bytesPerRow, - CGColorSpaceRef space, - CGBitmapInfo bitmapInfo*/); -void *CGBitmapContextGetData(CGContextRef context); - -// Include xpc. -typedef struct _xpc_connection_s * xpc_connection_t; -typedef void (*xpc_finalizer_t)(void *value); -void xpc_connection_set_context(xpc_connection_t connection, void *context); -void xpc_connection_set_finalizer_f(xpc_connection_t connection, xpc_finalizer_t finalizer); -void xpc_connection_resume(xpc_connection_t connection); -- cgit v1.2.3