[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / clang / test / Analysis / Inputs / system-header-simulator-for-malloc.h
blobbc7009eb0d1beaf19119e6f387cb91fe16e637c6
1 // Like the compiler, the static analyzer treats some functions differently if
2 // they come from a system header -- for example, it is assumed that system
3 // functions do not arbitrarily free() their parameters, and that some bugs
4 // found in system headers cannot be fixed by the user and should be
5 // suppressed.
6 #pragma clang system_header
8 typedef __typeof(sizeof(int)) size_t;
9 void *malloc(size_t);
10 void *calloc(size_t, size_t);
11 void free(void *);
12 void *alloca(size_t);
15 #if __OBJC__
17 #import "system-header-simulator-objc.h"
19 @interface Wrapper : NSData
20 - (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)len;
21 @end
23 @implementation Wrapper
24 - (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)len {
25 return [self initWithBytesNoCopy:bytes length:len freeWhenDone:1]; // no-warning
27 @end
29 @interface CustomData : NSData
30 + (id)somethingNoCopy:(char *)bytes;
31 + (id)somethingNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)freeBuffer;
32 + (id)something:(char *)bytes freeWhenDone:(BOOL)freeBuffer;
33 @end
35 #endif