]> granicus.if.org Git - clang/commitdiff
Provide an "Analysis Scope" for Analyses so checks can either be run on code declarat...
authorTed Kremenek <kremenek@apple.com>
Tue, 15 Jul 2008 00:46:02 +0000 (00:46 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 15 Jul 2008 00:46:02 +0000 (00:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53584 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/Analyses.def
Driver/AnalysisConsumer.cpp
Driver/AnalysisConsumer.h
Driver/clang.cpp
test/Analysis/ObjCRetSigs.m

index 1e04c9a8414c5c10d89c7e1adb9b3947a260650c..623a2475d6b77c0c444dc67a60719b6d272c09ee 100644 (file)
 //===----------------------------------------------------------------------===//
 
 ANALYSIS(CFGDump, "cfg-dump",
-         "Display Control-Flow Graphs")
+         "Display Control-Flow Graphs", Code)
 
 ANALYSIS(CFGView, "cfg-view",
-         "View Control-Flow Graphs using GraphViz")
+         "View Control-Flow Graphs using GraphViz", Code)
 
 ANALYSIS(DisplayLiveVariables, "dump-live-variables",
-         "Print results of live variable analysis")
+         "Print results of live variable analysis", Code)
 
 ANALYSIS(WarnDeadStores, "warn-dead-stores",
-         "Warn about stores to dead variables")
+         "Warn about stores to dead variables", Code)
 
 ANALYSIS(WarnUninitVals, "warn-uninit-values",
-         "Warn about uses of uninitialized variables")
+         "Warn about uses of uninitialized variables", Code)
 
 ANALYSIS(WarnObjCMethSigs, "warn-objc-methodsigs",
-"Warn about Objective-C method signatures with type incompatibilities")
+ "Warn about Objective-C method signatures with type incompatibilities",
+ ObjCImplementation)
 
 ANALYSIS(WarnObjCDealloc, "warn-objc-missing-dealloc",
-"Warn about Objective-C classes that lack a correct implementation of -dealloc")
+ "Warn about Objective-C classes that lack a correct implementation of -dealloc",
+ ObjCImplementation)
 
 ANALYSIS(CheckerSimple, "checker-simple",
-         "Perform simple path-sensitive checks.")
+         "Perform simple path-sensitive checks.", Code)
 
 ANALYSIS(CheckerCFRef, "checker-cfref",
-         "Run the [Core] Foundation reference count checker")   
+         "Run the [Core] Foundation reference count checker", Code)
 
 #undef ANALYSIS
index cd24e2efea4c9e27f1b68ed608cc1fdea5fea497..45e0918ce0811254c96df39199150a00c225b871 100644 (file)
@@ -414,9 +414,9 @@ ASTConsumer* clang::CreateAnalysisConsumer(Analyses* Beg, Analyses* End,
   
   for ( ; Beg != End ; ++Beg)
     switch (*Beg) {
-#define ANALYSIS(NAME, CMD, DESC)\
+#define ANALYSIS(NAME, CMD, DESC, SCOPE)\
       case NAME:\
-        C->addCodeAction(&Action ## NAME);\
+        C->add ## SCOPE ## Action(&Action ## NAME);\
         break;
 #include "Analyses.def"
       default: break;
index dfabe79e56bad51b37739a2417b8dc31fd8f1813..5a2550da43c0a52d25f9d8eaa577b7a4c285bd5b 100644 (file)
@@ -17,7 +17,7 @@
 namespace clang {
 
 enum Analyses {
-#define ANALYSIS(NAME, CMDFLAG, DESC) NAME,
+#define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE) NAME,
 #include "Analyses.def"
 NumAnalyses
 };
index 7ce730150e289bf982696e2aba4af9443b506f94..5e8f51cbc973b7ed9fa4798c71bbb54682c45465 100644 (file)
@@ -162,7 +162,7 @@ AnalyzeAll("checker-opt-analyze-headers",
 static llvm::cl::list<Analyses>
 AnalysisList(llvm::cl::desc("Available Source Code Analyses:"),
 llvm::cl::values(
-#define ANALYSIS(NAME, CMDFLAG, DESC)\
+#define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE)\
 clEnumValN(NAME, CMDFLAG, DESC),
 #include "Analyses.def"
 clEnumValEnd));
index 24b0f3aee5e0d236f2f05c4a8b0dc1c2396ebfb7..009f6c380805d8a77fd603491ca036018df558bb 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang -check-objc-methodsigs -verify %s
+// RUN: clang -warn-objc-methodsigs -verify %s
 
 #include <stdio.h>