]> granicus.if.org Git - clang/commitdiff
[analyzer] Turn on by default two checkers:
authorAnna Zaks <ganna@apple.com>
Sat, 4 Feb 2012 02:31:57 +0000 (02:31 +0000)
committerAnna Zaks <ganna@apple.com>
Sat, 4 Feb 2012 02:31:57 +0000 (02:31 +0000)
 - osx.coreFoundation.containers.IndexOutOfBounds
 - osx.cocoa.SelfInit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149747 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/Checkers.td
test/Analysis/CFContainers.mm
test/Analysis/self-init.m

index 7bf865ffcbb73d275477e19ed3c052785156c4ff..d08739e2a368d9282f3c6c77fc24c0ff658cc263 100644 (file)
@@ -40,7 +40,7 @@ def OSXExperimental : Package<"osx">, InPackage<Experimental>, Hidden;
 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 ObjCMethSigsChecker : Checker<"IncompatibleMethodTypes">,
 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 @@ def RetainCountChecker : Checker<"RetainCount">,
 
 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 @@ def CFErrorChecker : Checker<"CFError">,
 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.
index ec6746bb728624d6900f7e7625d79a9cd4b312cd..4912054882ebc04d74480a801f85059d1ebc2569 100644 (file)
@@ -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;
index 78d9399e8384a3f64ab1b477819b9959c73dea7b..eaa8fd46f19c94106fcc50e0beadecc5d9fe5800 100644 (file)
@@ -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