[cfe-commits] r53584 - in /cfe/trunk: Driver/Analyses.def Driver/AnalysisConsumer.cpp Driver/AnalysisConsumer.h Driver/clang.cpp test/Analysis/ObjCRetSigs.m

Ted Kremenek kremenek at apple.com
Mon Jul 14 17:46:03 PDT 2008


Author: kremenek
Date: Mon Jul 14 19:46:02 2008
New Revision: 53584

URL: http://llvm.org/viewvc/llvm-project?rev=53584&view=rev
Log:
Provide an "Analysis Scope" for Analyses so checks can either be run on code declarations (bodies) or Objective-C @implementation blocks.

Modified:
    cfe/trunk/Driver/Analyses.def
    cfe/trunk/Driver/AnalysisConsumer.cpp
    cfe/trunk/Driver/AnalysisConsumer.h
    cfe/trunk/Driver/clang.cpp
    cfe/trunk/test/Analysis/ObjCRetSigs.m

Modified: cfe/trunk/Driver/Analyses.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/Analyses.def?rev=53584&r1=53583&r2=53584&view=diff

==============================================================================
--- cfe/trunk/Driver/Analyses.def (original)
+++ cfe/trunk/Driver/Analyses.def Mon Jul 14 19:46:02 2008
@@ -12,30 +12,32 @@
 //===----------------------------------------------------------------------===//
 
 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

Modified: cfe/trunk/Driver/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/AnalysisConsumer.cpp?rev=53584&r1=53583&r2=53584&view=diff

==============================================================================
--- cfe/trunk/Driver/AnalysisConsumer.cpp (original)
+++ cfe/trunk/Driver/AnalysisConsumer.cpp Mon Jul 14 19:46:02 2008
@@ -414,9 +414,9 @@
   
   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;

Modified: cfe/trunk/Driver/AnalysisConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/AnalysisConsumer.h?rev=53584&r1=53583&r2=53584&view=diff

==============================================================================
--- cfe/trunk/Driver/AnalysisConsumer.h (original)
+++ cfe/trunk/Driver/AnalysisConsumer.h Mon Jul 14 19:46:02 2008
@@ -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
 };

Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=53584&r1=53583&r2=53584&view=diff

==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Mon Jul 14 19:46:02 2008
@@ -162,7 +162,7 @@
 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));

Modified: cfe/trunk/test/Analysis/ObjCRetSigs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/ObjCRetSigs.m?rev=53584&r1=53583&r2=53584&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/ObjCRetSigs.m (original)
+++ cfe/trunk/test/Analysis/ObjCRetSigs.m Mon Jul 14 19:46:02 2008
@@ -1,4 +1,4 @@
-// RUN: clang -check-objc-methodsigs -verify %s
+// RUN: clang -warn-objc-methodsigs -verify %s
 
 #include <stdio.h>
 





More information about the cfe-commits mailing list