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@-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@-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@-1{{Potential leak of an object stored into 'obj2'}}
-  // expected-note@-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@-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@-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@-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);
 


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@-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@-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@-1{{Potential leak of an object stored into 'obj2'}}
-  // expected-note@-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@-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@-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@-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);
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to