Fix '-analyzer-display-progress' for Objective-C methods.  Also remove obsolete code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117161 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Checker/AnalysisConsumer.cpp b/lib/Checker/AnalysisConsumer.cpp
index 94bce40..f902124 100644
--- a/lib/Checker/AnalysisConsumer.cpp
+++ b/lib/Checker/AnalysisConsumer.cpp
@@ -153,6 +153,10 @@
       llvm::errs() << ' ' << "block(line:" << Loc.getLine() << ",col:"
                    << Loc.getColumn() << '\n';
     }
+    else if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D)) {
+      Selector S = MD->getSelector();
+      llvm::errs() << ' ' << S.getAsString();
+    }
   }
 
   void addCodeAction(CodeAction action) {
@@ -218,19 +222,6 @@
       break;
     }
 
-    case Decl::ObjCMethod: {
-      ObjCMethodDecl* MD = cast<ObjCMethodDecl>(D);
-      
-      if (MD->isThisDeclarationADefinition()) {
-        if (!Opts.AnalyzeSpecificFunction.empty() &&
-            Opts.AnalyzeSpecificFunction != MD->getSelector().getAsString())
-          break;
-        DisplayFunction(MD);
-        HandleCode(MD, ObjCMethodActions);
-      }
-      break;
-    }
-
     case Decl::ObjCImplementation: {
       ObjCImplementationDecl* ID = cast<ObjCImplementationDecl>(*I);
       HandleCode(ID, ObjCImplementationActions);
@@ -241,6 +232,7 @@
           if (!Opts.AnalyzeSpecificFunction.empty() &&
              Opts.AnalyzeSpecificFunction != (*MI)->getSelector().getAsString())
             break;
+          DisplayFunction(*MI);
           HandleCode(*MI, ObjCMethodActions);
         }
       }