]> granicus.if.org Git - clang/commitdiff
Fix '-analyzer-display-progress' for Objective-C methods. Also remove obsolete code.
authorTed Kremenek <kremenek@apple.com>
Fri, 22 Oct 2010 22:08:29 +0000 (22:08 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 22 Oct 2010 22:08:29 +0000 (22:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117161 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/AnalysisConsumer.cpp

index 94bce40c18489dad8bbe515aa3ef12c4375f819a..f902124613cea4eb9d521e0f4f7c65a044e47370 100644 (file)
@@ -153,6 +153,10 @@ public:
       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 @@ void AnalysisConsumer::HandleTranslationUnit(ASTContext &C) {
       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 @@ void AnalysisConsumer::HandleTranslationUnit(ASTContext &C) {
           if (!Opts.AnalyzeSpecificFunction.empty() &&
              Opts.AnalyzeSpecificFunction != (*MI)->getSelector().getAsString())
             break;
+          DisplayFunction(*MI);
           HandleCode(*MI, ObjCMethodActions);
         }
       }