diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index e01b5f2a1090..97c3c69709cc 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -1352,7 +1352,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-analyzer-checker=deadcode"); // Enable the following experimental checkers for testing. - CmdArgs.push_back("-analyzer-checker=experimental.osx.cocoa.ContainerAPI"); CmdArgs.push_back("-analyzer-checker=security.insecureAPI.UncheckedReturn"); CmdArgs.push_back("-analyzer-checker=security.insecureAPI.getpw"); CmdArgs.push_back("-analyzer-checker=security.insecureAPI.gets"); diff --git a/clang/lib/StaticAnalyzer/Checkers/Checkers.td b/clang/lib/StaticAnalyzer/Checkers/Checkers.td index e8be816de4b6..b713d5d331b0 100644 --- a/clang/lib/StaticAnalyzer/Checkers/Checkers.td +++ b/clang/lib/StaticAnalyzer/Checkers/Checkers.td @@ -39,6 +39,7 @@ def OSXExperimental : Package<"osx">, InPackage, Hidden; def Cocoa : Package<"cocoa">, InPackage; def CocoaExperimental : Package<"cocoa">, InPackage, Hidden; def CoreFoundation : Package<"coreFoundation">, InPackage; +def Containers : Package<"Containers">, InPackage; def LLVM : Package<"llvm">; def Debug : Package<"debug">; @@ -364,10 +365,6 @@ def RetainCountChecker : Checker<"RetainCount">, HelpText<"Check for leaks and improper reference count management">, DescFile<"RetainCountChecker.cpp">; -def ObjCContainersASTChecker : Checker<"CFContainersSyntax">, - HelpText<"Check for common pitfalls when using 'CFArray', 'CFDictionary', 'CFSet' APIs">, - DescFile<"ObjCContainersASTChecker.cpp">; - } // end "cocoa" let ParentPackage = CocoaExperimental in { @@ -401,6 +398,11 @@ def CFErrorChecker : Checker<"CFError">, DescFile<"NSErrorChecker.cpp">; } +let ParentPackage = Containers in { +def ObjCContainersASTChecker : Checker<"PointerSizedValues">, + HelpText<"Warns if 'CFArray', 'CFDictionary', 'CFSet' are created with non-pointer-size values">, + DescFile<"ObjCContainersASTChecker.cpp">; +} //===----------------------------------------------------------------------===// // Checkers for LLVM development. //===----------------------------------------------------------------------===// diff --git a/clang/test/Analysis/CFContainers.mm b/clang/test/Analysis/CFContainers.mm index 836614070e3c..5243c1581783 100644 --- a/clang/test/Analysis/CFContainers.mm +++ b/clang/test/Analysis/CFContainers.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.CFContainersSyntax,experimental.osx.cocoa.Containers -analyzer-store=region -triple x86_64-apple-darwin -verify %s +// RUN: %clang_cc1 -analyze -analyzer-checker=osx.coreFoundation.Containers.PointerSizedValues,experimental.osx.cocoa.Containers -analyzer-store=region -triple x86_64-apple-darwin -verify %s typedef const struct __CFAllocator * CFAllocatorRef; typedef const struct __CFString * CFStringRef;