annotation on methods which return typedef of pointer to
an incomplete struct type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190372
91177308-0d34-0410-b5e6-
96231b3b80d8
if (T->isObjCObjectPointerType() || T->isObjCBuiltinType() ||
T->isBlockPointerType() || ento::coreFoundation::isCFObjectRef(T))
return false;
+ // Also, typedef-of-pointer-to-incomplete-struct is something that we assume
+ // is not an innter pointer type.
+ QualType OrigT = T;
+ while (const TypedefType *TD = dyn_cast<TypedefType>(T.getTypePtr()))
+ T = TD->getDecl()->getUnderlyingType();
+ if (OrigT == T || !T->isPointerType())
+ return true;
+ const PointerType* PT = T->getAs<PointerType>();
+ QualType UPointeeT = PT->getPointeeType().getUnqualifiedType();
+ if (UPointeeT->isRecordType()) {
+ const RecordType *RecordTy = UPointeeT->getAs<RecordType>();
+ if (!RecordTy->getDecl()->isCompleteDefinition())
+ return false;
+ }
return true;
}
typedef struct CGImage *CGImageRef;
+typedef struct OpaqueJSValue* JSObjectRef;
+
+typedef JSObjectRef TTJSObjectRef;
+
CF_IMPLICIT_BRIDGING_DISABLED
@interface I
@interface NSMutableData
- (void *)mutableBytes __attribute__((deprecated)) __attribute__((unavailable));
@end
+
+@interface JS
+- (JSObjectRef)JSObject;
+- (TTJSObjectRef)JSObject1;
+- (JSObjectRef*)JSObject2;
+@end
typedef struct CGImage *CGImageRef;
+typedef struct OpaqueJSValue* JSObjectRef;
+
+typedef JSObjectRef TTJSObjectRef;
+
CF_IMPLICIT_BRIDGING_DISABLED
@interface I
@interface NSMutableData
- (void *)mutableBytes __attribute__((deprecated)) __attribute__((unavailable)) NS_RETURNS_INNER_POINTER;
@end
+
+@interface JS
+- (JSObjectRef)JSObject;
+- (TTJSObjectRef)JSObject1;
+- (JSObjectRef*)JSObject2 NS_RETURNS_INNER_POINTER;
+@end