* don't show notes about "unused" private fields of external obj-c class

declarations (since even though they're not used in the Pascal code,
    they probably are in the Objective-C code that actually implements them)

git-svn-id: branches/objc@13764 -
This commit is contained in:
Jonas Maebe 2009-09-27 15:28:49 +00:00
parent 0c675a4039
commit 046b652c28
2 changed files with 18 additions and 4 deletions

View File

@ -528,10 +528,12 @@ implementation
{ In case of an objcclass, verify that all methods have a message
name set. We only check this now, because message names can be set
during the protocol (interface) mapping. At the same time, set the
mangled names (these depend on the "external" name of the class).
mangled names (these depend on the "external" name of the class),
and mark private fields of external classes as "used" (to avoid
bogus notes about them being unused)
}
if is_objc_class_or_protocol(hdef) then
tobjectdef(hdef).check_and_finish_messages;
tobjectdef(hdef).finish_objc_data;
end;
recorddef :

View File

@ -306,7 +306,7 @@ interface
procedure register_vmt_call(index:longint);
{ ObjC }
procedure make_all_methods_external;
procedure check_and_finish_messages;
procedure finish_objc_data;
end;
tclassrefdef = class(tabstractpointerdef)
@ -4536,9 +4536,21 @@ implementation
end;
procedure tobjectdef.check_and_finish_messages;
procedure mark_private_fields_used(data: tobject; arg: pointer);
var
sym: tsym absolute data;
begin
if (sym.typ=fieldvarsym) and
(tfieldvarsym(sym).visibility in [vis_private,vis_strictprivate]) then
sym.IncRefCount;
end;
procedure tobjectdef.finish_objc_data;
begin
self.symtable.DefList.foreachcall(@check_and_finish_msg,nil);
if (oo_is_external in objectoptions) then
self.symtable.SymList.ForEachCall(@mark_private_fields_used,nil);
end;