Tweak -Wobjc-missing-super-calls to not warning about missing [super dealloc] when in GC-only mode, and to not warning about missing [super finalize] when not using GC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140713 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 0822edf..f1a2637 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -335,10 +335,11 @@
     // Only do this if the current class actually has a superclass.
     if (IC->getSuperClass()) {
       ObjCShouldCallSuperDealloc = 
-        !Context.getLangOptions().ObjCAutoRefCount &&      
+        !(Context.getLangOptions().ObjCAutoRefCount ||
+          Context.getLangOptions().getGC() == LangOptions::GCOnly) &&
         MDecl->getMethodFamily() == OMF_dealloc;
       ObjCShouldCallSuperFinalize =
-        !Context.getLangOptions().ObjCAutoRefCount &&      
+        Context.getLangOptions().getGC() != LangOptions::NonGC &&
         MDecl->getMethodFamily() == OMF_finalize;
     }
   }