[PATCH] D102863: rdar://77307290 (Disable retain-count tracking for references to OSMetaClass)

Georgeta Igna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 20 12:00:19 PDT 2021


georgi_igna created this revision.
georgi_igna requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

OSMetaClass does not use reference-counting. We should ignore references to OSMetaClass in class RetainSummaryManager.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102863

Files:
  clang/test/Analysis/osobject-retain-release.cpp


Index: clang/test/Analysis/osobject-retain-release.cpp
===================================================================
--- clang/test/Analysis/osobject-retain-release.cpp
+++ clang/test/Analysis/osobject-retain-release.cpp
@@ -155,20 +155,12 @@
 void use_always_write_into_two_out_params_leak() {
   OSObject *obj1;
   OSObject *obj2;
-  always_write_into_two_out_params(
-      &obj1, &obj2); // expected-note-re{{Call to function
-                     // 'always_write_into_two_out_params' writes an OSObject of
-                     // type 'OSObject' with a +1 retain count into an out
-                     // parameter 'a'{{$}}}} expected-note-re at -1{{Call to
-                     // function 'always_write_into_two_out_params' writes an
-                     // OSObject of type 'OSObject' with a +1 retain count into
-                     // an out parameter 'b'{{$}}}}
+  always_write_into_two_out_params(&obj1, &obj2); // expected-note-re{{Call to function 'always_write_into_two_out_params' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'a'{{$}}}}
+                                                  // expected-note-re at -1{{Call to function 'always_write_into_two_out_params' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'b'{{$}}}}
 } // expected-warning{{Potential leak of an object stored into 'obj1'}}
   // expected-warning at -1{{Potential leak of an object stored into 'obj2'}}
-  // expected-note at -2{{Object leaked: object allocated and stored into 'obj1' is
-  // not referenced later in this execution path and has a retain count of +1}}
-  // expected-note at -3{{Object leaked: object allocated and stored into 'obj2' is
-  // not referenced later in this execution path and has a retain count of +1}}
+  // expected-note at -2{{Object leaked: object allocated and stored into 'obj1' is not referenced later in this execution path and has a retain count of +1}}
+  // expected-note at -3{{Object leaked: object allocated and stored into 'obj2' is not referenced later in this execution path and has a retain count of +1}}
 
 char *write_into_out_param_on_nonnull(OS_RETURNS_RETAINED OSObject **obj);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102863.346818.patch
Type: text/x-patch
Size: 2190 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210520/162b5e44/attachment.bin>


More information about the cfe-commits mailing list