Author: aaronballman
Date: Fri Nov 30 10:52:51 2018
New Revision: 348020

URL: http://llvm.org/viewvc/llvm-project?rev=348020&view=rev
Log:
Reverting r347949-r347951 because they broke the test bots.

http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/440/steps/ninja%20check%202/logs/FAIL%3A%20Clang%3A%3Aosobject-retain-release.cpp

Modified:
    cfe/trunk/.gitignore
    cfe/trunk/include/clang/StaticAnalyzer/Core/RetainSummaryManager.h
    cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp
    cfe/trunk/test/Analysis/osobject-retain-release.cpp
    cfe/trunk/test/Misc/pragma-attribute-supported-attributes-list.test

Modified: cfe/trunk/.gitignore
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/.gitignore?rev=348020&r1=348019&r2=348020&view=diff
==============================================================================
--- cfe/trunk/.gitignore (original)
+++ cfe/trunk/.gitignore Fri Nov 30 10:52:51 2018
@@ -29,8 +29,6 @@ cscope.out
 
#==============================================================================#
 # Directories to ignore (do not add trailing '/'s, they skip symlinks).
 
#==============================================================================#
-# Clang extra user tools, which is tracked independently (clang-tools-extra).
-tools/extra
 # Sphinx build products
 docs/_build
 docs/analyzer/_build

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/RetainSummaryManager.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/RetainSummaryManager.h?rev=348020&r1=348019&r2=348020&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/RetainSummaryManager.h 
(original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/RetainSummaryManager.h Fri Nov 
30 10:52:51 2018
@@ -530,8 +530,6 @@ class RetainSummaryManager {
   /// Decrement the reference count on OS object.
   const RetainSummary *getOSSummaryReleaseRule(const FunctionDecl *FD);
 
-  /// Free the OS object.
-  const RetainSummary *getOSSummaryFreeRule(const FunctionDecl *FD);
 
   enum UnaryFuncKind { cfretain, cfrelease, cfautorelease, cfmakecollectable };
 

Modified: cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp?rev=348020&r1=348019&r2=348020&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp Fri Nov 30 
10:52:51 2018
@@ -124,8 +124,10 @@ RetainSummaryManager::generateSummary(co
   }
 
   const IdentifierInfo *II = FD->getIdentifier();
+  if (!II)
+    return getDefaultSummary();
 
-  StringRef FName = II ? II->getName() : "";
+  StringRef FName = II->getName();
 
   // Strip away preceding '_'.  Doing this here will effect all the checks
   // down below.
@@ -302,12 +304,6 @@ RetainSummaryManager::generateSummary(co
 
       if (FName == "retain")
         return getOSSummaryRetainRule(FD);
-
-      if (FName == "free")
-        return getOSSummaryFreeRule(FD);
-
-      if (MD->getOverloadedOperator() == OO_New)
-        return getOSSummaryCreateRule(MD);
     }
   }
 
@@ -495,11 +491,9 @@ RetainSummaryManager::getSummary(const C
   case CE_CXXConstructor:
     Summ = getFunctionSummary(cast<CXXConstructorCall>(Call).getDecl());
     break;
-  case CE_CXXAllocator:
-    Summ = getFunctionSummary(cast<CXXAllocatorCall>(Call).getDecl());
-    break;
   case CE_Block:
   case CE_CXXDestructor:
+  case CE_CXXAllocator:
     // FIXME: These calls are currently unsupported.
     return getPersistentStopSummary();
   case CE_ObjCMessage: {
@@ -625,14 +619,6 @@ RetainSummaryManager::getOSSummaryReleas
 }
 
 const RetainSummary *
-RetainSummaryManager::getOSSummaryFreeRule(const FunctionDecl *FD) {
-  return getPersistentSummary(RetEffect::MakeNoRet(),
-                              /*ReceiverEff=*/DoNothing,
-                              /*DefaultEff=*/DoNothing,
-                              /*ThisEff=*/Dealloc);
-}
-
-const RetainSummary *
 RetainSummaryManager::getOSSummaryCreateRule(const FunctionDecl *FD) {
   return getPersistentSummary(RetEffect::MakeOwned(RetEffect::OS));
 }

Modified: cfe/trunk/test/Analysis/osobject-retain-release.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/osobject-retain-release.cpp?rev=348020&r1=348019&r2=348020&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/osobject-retain-release.cpp (original)
+++ cfe/trunk/test/Analysis/osobject-retain-release.cpp Fri Nov 30 10:52:51 2018
@@ -14,7 +14,6 @@ struct OSMetaClass;
 struct OSObject {
   virtual void retain();
   virtual void release() {};
-  virtual void free();
   virtual ~OSObject(){}
 
   unsigned int foo() { return 42; }
@@ -24,9 +23,6 @@ struct OSObject {
   static OSObject *getObject();
   static OSObject *GetObject();
 
-
-  static void * operator new(unsigned long size);
-
   static const OSMetaClass * const metaClass;
 };
 
@@ -66,34 +62,6 @@ struct OSMetaClassBase {
   static OSObject *safeMetaCast(const OSObject *inst, const OSMetaClass *meta);
 };
 
-void check_free_no_error() {
-  OSArray *arr = OSArray::withCapacity(10);
-  arr->retain();
-  arr->retain();
-  arr->retain();
-  arr->free();
-}
-
-void check_free_use_after_free() {
-  OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 
'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain 
count}}
-  arr->retain(); // expected-note{{Reference count incremented. The object now 
has a +2 retain count}}
-  arr->free(); // expected-note{{Object released}}
-  arr->retain(); // expected-warning{{Reference-counted object is used after 
it is released}}
-                 // expected-note@-1{{Reference-counted object is used after 
it is released}}
-}
-
-unsigned int check_leak_explicit_new() {
-  OSArray *arr = new OSArray; // expected-note{{Operator new returns an 
OSObject of type OSArray with a +1 retain count}}
-  return arr->getCount(); // expected-note{{Object leaked: allocated object of 
type OSArray is not referenced later in this execution path and has a retain 
count of +1}}
-                          // expected-warning@-1{{Potential leak of an object 
of type OSArray}}
-}
-
-unsigned int check_leak_factory() {
-  OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 
'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain 
count}}
-  return arr->getCount(); // expected-note{{Object leaked: object allocated 
and stored into 'arr' is not referenced later in this execution path and has a 
retain count of +1}}
-                          // expected-warning@-1{{Potential leak of an object 
stored into 'arr'}}
-}
-
 void check_get_object() {
   OSObject::getObject();
 }

Modified: cfe/trunk/test/Misc/pragma-attribute-supported-attributes-list.test
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/pragma-attribute-supported-attributes-list.test?rev=348020&r1=348019&r2=348020&view=diff
==============================================================================
--- cfe/trunk/test/Misc/pragma-attribute-supported-attributes-list.test 
(original)
+++ cfe/trunk/test/Misc/pragma-attribute-supported-attributes-list.test Fri Nov 
30 10:52:51 2018
@@ -2,7 +2,7 @@
 
 // The number of supported attributes should never go down!
 
-// CHECK: #pragma clang attribute supports 133 attributes:
+// CHECK: #pragma clang attribute supports 132 attributes:
 // CHECK-NEXT: AMDGPUFlatWorkGroupSize (SubjectMatchRule_function)
 // CHECK-NEXT: AMDGPUNumSGPR (SubjectMatchRule_function)
 // CHECK-NEXT: AMDGPUNumVGPR (SubjectMatchRule_function)
@@ -86,8 +86,8 @@
 // CHECK-NEXT: NoThrow (SubjectMatchRule_function)
 // CHECK-NEXT: NotTailCalled (SubjectMatchRule_function)
 // CHECK-NEXT: OSConsumed (SubjectMatchRule_variable_is_parameter)
-// CHECK-NEXT: OSReturnsNotRetained (SubjectMatchRule_function, 
SubjectMatchRule_objc_method, SubjectMatchRule_objc_property)
-// CHECK-NEXT: OSReturnsRetained (SubjectMatchRule_function, 
SubjectMatchRule_objc_method, SubjectMatchRule_objc_property)
+// CHECK-NEXT: OSReturnsNotRetained (SubjectMatchRule_function, 
SubjectMatchRule_objc_method)
+// CHECK-NEXT: OSReturnsRetained (SubjectMatchRule_function, 
SubjectMatchRule_objc_method)
 // CHECK-NEXT: ObjCBoxable (SubjectMatchRule_record)
 // CHECK-NEXT: ObjCBridge (SubjectMatchRule_record, 
SubjectMatchRule_type_alias)
 // CHECK-NEXT: ObjCBridgeMutable (SubjectMatchRule_record)


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to