ObjCNSObject,
CFOwnershipRelease, // Clang/Checker-specific.
CFOwnershipRetain, // Clang/Checker-specific.
- NSOwnershipMakeCollectable, // Clang/Checker-specific.
NSOwnershipRelease, // Clang/Checker-specific.
NSOwnershipRetain, // Clang/Checker-specific.
NSOwnershipReturns, // Clang/Checker-specific.
DEF_SIMPLE_ATTR(NSOwnershipRelease);
DEF_SIMPLE_ATTR(CFOwnershipRetain);
DEF_SIMPLE_ATTR(NSOwnershipRetain);
-DEF_SIMPLE_ATTR(NSOwnershipMakeCollectable);
DEF_SIMPLE_ATTR(NSOwnershipReturns);
#undef DEF_SIMPLE_ATTR
AT_objc_exception,
AT_cf_ownership_release, // Clang-specific.
AT_cf_ownership_retain, // Clang-specific.
- AT_ns_ownership_make_collectable, // Clang-specific.
AT_ns_ownership_release, // Clang-specific.
AT_ns_ownership_retain, // Clang-specific.
AT_ns_ownership_returns, // Clang-specific.
Summ.setArgEffect(AF, i, DecRefMsg);
else if (PD->getAttr<CFOwnershipReleaseAttr>())
Summ.setArgEffect(AF, i, DecRef);
- else if (PD->getAttr<NSOwnershipMakeCollectableAttr>())
- Summ.setArgEffect(AF, i, MakeCollectable);
}
void
SIMPLE_ATTR(ObjCNSObject);
SIMPLE_ATTR(CFOwnershipRelease);
SIMPLE_ATTR(CFOwnershipRetain);
- SIMPLE_ATTR(NSOwnershipMakeCollectable);
SIMPLE_ATTR(NSOwnershipRelease);
SIMPLE_ATTR(NSOwnershipRetain);
SIMPLE_ATTR(NSOwnershipReturns);
case Attr::ObjCNSObject:
case Attr::CFOwnershipRelease:
case Attr::CFOwnershipRetain:
- case Attr::NSOwnershipMakeCollectable:
case Attr::NSOwnershipRelease:
case Attr::NSOwnershipRetain:
case Attr::NSOwnershipReturns:
if (!memcmp(Str, "no_instrument_function", 22))
return AT_no_instrument_function;
break;
- case 29:
- if (!memcmp(Str, "ns_ownership_make_collectable", 29))
- return AT_ns_ownership_make_collectable;
- break;
}
return UnknownAttribute;
}
name = "cf_ownership_release"; break;
case AttributeList::AT_cf_ownership_retain:
name = "cf_ownership_retain"; break;
- case AttributeList::AT_ns_ownership_make_collectable:
- name = "ns_ownership_make_collectable"; break;
case AttributeList::AT_ns_ownership_release:
name = "ns_ownership_release"; break;
case AttributeList::AT_ns_ownership_retain:
d->addAttr(::new (S.Context) CFOwnershipReleaseAttr()); return;
case AttributeList::AT_cf_ownership_retain:
d->addAttr(::new (S.Context) CFOwnershipRetainAttr()); return;
- case AttributeList::AT_ns_ownership_make_collectable:
- d->addAttr(::new (S.Context) NSOwnershipMakeCollectableAttr()); return;
case AttributeList::AT_ns_ownership_release:
d->addAttr(::new (S.Context) NSOwnershipReleaseAttr()); return;
case AttributeList::AT_ns_ownership_retain:
case AttributeList::AT_cf_ownership_release:
case AttributeList::AT_cf_ownership_retain:
HandleNSOwnershipAttr(D, Attr, S); break;
- case AttributeList::AT_ns_ownership_make_collectable:
case AttributeList::AT_ns_ownership_release:
case AttributeList::AT_ns_ownership_retain:
HandleNSOwnershipAttr(D, Attr, S, true); break;
- (void) myCFRetain:(id)__attribute__((cf_ownership_retain))obj;
- (void) myRelease:(id)__attribute__((ns_ownership_release))obj;
- (void) myCFRelease:(id)__attribute__((cf_ownership_release))obj;
-- (void) makeCollectable:(id)__attribute__((ns_ownership_make_collectable))obj;
@end
void test_attr_1(TestOwnershipAttr *X) {
void test_attr_6b(TestOwnershipAttr *X) {
CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
- [X makeCollectable:(id)A];
+ CFMakeCollectable(A);
}