[cfe-commits] r149747 - in /cfe/trunk: lib/StaticAnalyzer/Checkers/Checkers.td test/Analysis/CFContainers.mm test/Analysis/self-init.m
Anna Zaks
ganna at apple.com
Fri Feb 3 18:31:57 PST 2012
Author: zaks
Date: Fri Feb 3 20:31:57 2012
New Revision: 149747
URL: http://llvm.org/viewvc/llvm-project?rev=149747&view=rev
Log:
[analyzer] Turn on by default two checkers:
- osx.coreFoundation.containers.IndexOutOfBounds
- osx.cocoa.SelfInit
Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td
cfe/trunk/test/Analysis/CFContainers.mm
cfe/trunk/test/Analysis/self-init.m
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td?rev=149747&r1=149746&r2=149747&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td Fri Feb 3 20:31:57 2012
@@ -40,7 +40,7 @@
def Cocoa : Package<"cocoa">, InPackage<OSX>;
def CocoaExperimental : Package<"cocoa">, InPackage<OSXExperimental>, Hidden;
def CoreFoundation : Package<"coreFoundation">, InPackage<OSX>;
-def Containers : Package<"Containers">, InPackage<CoreFoundation>;
+def Containers : Package<"containers">, InPackage<CoreFoundation>;
def LLVM : Package<"llvm">;
def Debug : Package<"debug">;
@@ -364,7 +364,11 @@
def ObjCUnusedIvarsChecker : Checker<"UnusedIvars">,
HelpText<"Warn about private ivars that are never used">,
DescFile<"ObjCUnusedIVarsChecker.cpp">;
-
+
+def ObjCSelfInitChecker : Checker<"SelfInit">,
+ HelpText<"Check that 'self' is properly initialized inside an initializer method">,
+ DescFile<"ObjCSelfInitChecker.cpp">;
+
def NSErrorChecker : Checker<"NSError">,
HelpText<"Check usage of NSError** parameters">,
DescFile<"NSErrorChecker.cpp">;
@@ -377,14 +381,6 @@
let ParentPackage = CocoaExperimental in {
-def ObjCContainersChecker : Checker<"Containers">,
- HelpText<"Deep checks for common pitfalls when using 'CFArray' APIs">,
- DescFile<"ObjCContainersChecker.cpp">;
-
-def ObjCSelfInitChecker : Checker<"SelfInit">,
- HelpText<"Check that 'self' is properly initialized inside an initializer method">,
- DescFile<"ObjCSelfInitChecker.cpp">;
-
def ObjCDeallocChecker : Checker<"Dealloc">,
HelpText<"Warn about Objective-C classes that lack a correct implementation of -dealloc">,
DescFile<"CheckObjCDealloc.cpp">;
@@ -409,7 +405,12 @@
let ParentPackage = Containers in {
def ObjCContainersASTChecker : Checker<"PointerSizedValues">,
HelpText<"Warns if 'CFArray', 'CFDictionary', 'CFSet' are created with non-pointer-size values">,
- DescFile<"ObjCContainersASTChecker.cpp">;
+ DescFile<"ObjCContainersASTChecker.cpp">;
+
+def ObjCContainersChecker : Checker<"OutOfBounds">,
+ HelpText<"Checks for index out of bounds when using 'CFArray' API">,
+ DescFile<"ObjCContainersChecker.cpp">;
+
}
//===----------------------------------------------------------------------===//
// Checkers for LLVM development.
Modified: cfe/trunk/test/Analysis/CFContainers.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/CFContainers.mm?rev=149747&r1=149746&r2=149747&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/CFContainers.mm (original)
+++ cfe/trunk/test/Analysis/CFContainers.mm Fri Feb 3 20:31:57 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=osx.coreFoundation.Containers.PointerSizedValues,experimental.osx.cocoa.Containers -analyzer-store=region -triple x86_64-apple-darwin -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=osx.coreFoundation.containers.PointerSizedValues,osx.coreFoundation.containers.OutOfBounds -analyzer-store=region -triple x86_64-apple-darwin -verify %s
typedef const struct __CFAllocator * CFAllocatorRef;
typedef const struct __CFString * CFStringRef;
Modified: cfe/trunk/test/Analysis/self-init.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/self-init.m?rev=149747&r1=149746&r2=149747&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/self-init.m (original)
+++ cfe/trunk/test/Analysis/self-init.m Fri Feb 3 20:31:57 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.osx.cocoa.SelfInit %s -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit %s -verify
@class NSZone, NSCoder;
@protocol NSObject
More information about the cfe-commits
mailing list