unsigned i = 0;
for (FunctionDecl::param_const_iterator pi = FuncDecl->param_begin(),
pe = FuncDecl->param_end(); pi != pe; ++pi, ++i) {
+ const ParmVarDecl *pd = *pi;
ArgEffect AE = AEArgs[i];
if (AE == DecRef /*CFConsumed annotated*/ ||
AE == IncRef) {
+ if (AE == DecRef && !pd->getAttr<CFConsumedAttr>() &&
+ Ctx.Idents.get("CF_CONSUMED").hasMacroDefinition()) {
+ edit::Commit commit(*Editor);
+ commit.insertBefore(pd->getLocation(), "CF_CONSUMED ");
+ Editor->commit(commit);
+ HasAtLeastOnePointer = true;
+ }
+ // When AE == IncRef, there is no attribute to annotate with.
+ // It is assumed that compiler will extract the info. from function
+ // API name.
HasAtLeastOnePointer = true;
continue;
}
- const ParmVarDecl *pd = *pi;
QualType AT = pd->getType();
bool IsPointer;
if (!AuditedType(AT, IsPointer))
CF_IMPLICIT_BRIDGING_ENABLED
-extern void CFRelease(CFTypeRef cf);
+extern void CFRelease(CFTypeRef CF_CONSUMED cf);
CF_IMPLICIT_BRIDGING_DISABLED
CF_IMPLICIT_BRIDGING_ENABLED
-io_service_t IOServiceGetMatchingService( mach_port_t masterPort, CFDictionaryRef matching );
-kern_return_t IOServiceGetMatchingServices( mach_port_t masterPort, CFDictionaryRef matching, io_iterator_t * existing );
-kern_return_t IOServiceAddNotification( mach_port_t masterPort, const io_name_t notificationType, CFDictionaryRef matching, mach_port_t wakePort, uintptr_t reference, io_iterator_t * notification ) __attribute__((deprecated));
+io_service_t IOServiceGetMatchingService( mach_port_t masterPort, CFDictionaryRef CF_CONSUMED matching );
+kern_return_t IOServiceGetMatchingServices( mach_port_t masterPort, CFDictionaryRef CF_CONSUMED matching, io_iterator_t * existing );
+kern_return_t IOServiceAddNotification( mach_port_t masterPort, const io_name_t notificationType, CFDictionaryRef CF_CONSUMED matching, mach_port_t wakePort, uintptr_t reference, io_iterator_t * notification ) __attribute__((deprecated));
CF_IMPLICIT_BRIDGING_DISABLED
// expected-note {{'IOServiceAddNotification' declared here}}
-kern_return_t IOServiceAddMatchingNotification( IONotificationPortRef notifyPort, const io_name_t notificationType, CFDictionaryRef matching, IOServiceMatchingCallback callback, void * refCon, io_iterator_t * notification );
+kern_return_t IOServiceAddMatchingNotification( IONotificationPortRef notifyPort, const io_name_t notificationType, CFDictionaryRef CF_CONSUMED matching, IOServiceMatchingCallback callback, void * refCon, io_iterator_t * notification );
CF_IMPLICIT_BRIDGING_ENABLED
CF_IMPLICIT_BRIDGING_ENABLED
-extern void CGGradientRelease(CGGradientRef gradient);
+extern void CGGradientRelease(CGGradientRef CF_CONSUMED gradient);
CF_IMPLICIT_BRIDGING_DISABLED