forked from OSchip/llvm-project
Teach the static analyzer to not treat XPC types as CF types.
llvm-svn: 147506
This commit is contained in:
parent
e8300e5eba
commit
990464cb30
|
@ -68,7 +68,9 @@ bool cocoa::isRefType(QualType RetTy, StringRef Prefix,
|
|||
StringRef TDName = TD->getDecl()->getIdentifier()->getName();
|
||||
if (TDName.startswith(Prefix) && TDName.endswith("Ref"))
|
||||
return true;
|
||||
|
||||
// XPC unfortunately uses CF-style function names, but aren't CF types.
|
||||
if (TDName.startswith("xpc_"))
|
||||
return false;
|
||||
RetTy = TD->getDecl()->getUnderlyingType();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ typedef unsigned int uint32_t;
|
|||
typedef unsigned long long uint64_t;
|
||||
typedef unsigned int UInt32;
|
||||
typedef signed long CFIndex;
|
||||
typedef CFIndex CFByteOrder;
|
||||
typedef struct {
|
||||
CFIndex location;
|
||||
CFIndex length;
|
||||
|
@ -1604,3 +1605,18 @@ void rdar10232019_positive() {
|
|||
NSLog(@"%@", otherString);
|
||||
}
|
||||
|
||||
// RetainCountChecker support for XPC.
|
||||
// <rdar://problem/9658496>
|
||||
typedef void * xpc_object_t;
|
||||
xpc_object_t _CFXPCCreateXPCObjectFromCFObject(CFTypeRef cf);
|
||||
void xpc_release(xpc_object_t object);
|
||||
|
||||
void rdar9658496() {
|
||||
CFStringRef cf;
|
||||
xpc_object_t xpc;
|
||||
cf = CFStringCreateWithCString( ((CFAllocatorRef)0), "test", kCFStringEncodingUTF8 ); // no-warning
|
||||
xpc = _CFXPCCreateXPCObjectFromCFObject( cf );
|
||||
CFRelease(cf);
|
||||
xpc_release(xpc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue