[cfe-commits] r128475 - in /cfe/trunk: include/clang/StaticAnalyzer/Checkers/CheckerBase.td lib/StaticAnalyzer/Checkers/Checkers.td
Argyrios Kyrtzidis
akyrtzi at gmail.com
Tue Mar 29 11:54:02 PDT 2011
Author: akirtzidis
Date: Tue Mar 29 13:54:02 2011
New Revision: 128475
URL: http://llvm.org/viewvc/llvm-project?rev=128475&view=rev
Log:
[analyzer] Checker Packages can now belong to a group. This requires llvm commit r128474.
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td
Modified: cfe/trunk/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Checkers/CheckerBase.td?rev=128475&r1=128474&r2=128475&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Checkers/CheckerBase.td (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Checkers/CheckerBase.td Tue Mar 29 13:54:02 2011
@@ -11,18 +11,19 @@
//
//===----------------------------------------------------------------------===//
+class CheckerGroup<string name> {
+ string GroupName = name;
+}
+class InGroup<CheckerGroup G> { CheckerGroup Group = G; }
+
class Package<string name> {
string PackageName = name;
bit Hidden = 0;
Package ParentPackage;
+ CheckerGroup Group;
}
class InPackage<Package P> { Package ParentPackage = P; }
-class CheckerGroup<string name> {
- string GroupName = name;
-}
-class InGroup<CheckerGroup G> { CheckerGroup Group = G; }
-
// All checkers are an indirect subclass of this.
class Checker<string name = ""> {
string CheckerName = name;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td?rev=128475&r1=128474&r2=128475&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/Checkers.td Tue Mar 29 13:54:02 2011
@@ -10,42 +10,47 @@
include "clang/StaticAnalyzer/Checkers/CheckerBase.td"
//===----------------------------------------------------------------------===//
+// Groups.
+//===----------------------------------------------------------------------===//
+
+def AllExperimental : CheckerGroup<"all-experimental">;
+
+//===----------------------------------------------------------------------===//
// Packages.
//===----------------------------------------------------------------------===//
def Core : Package<"core">;
def CoreBuiltin : Package<"builtin">, InPackage<Core>;
def CoreUninitialized : Package<"uninitialized">, InPackage<Core>;
-def CoreExperimental : Package<"experimental">, InPackage<Core>, Hidden;
+def CoreExperimental : Package<"experimental">, InPackage<Core>,
+ InGroup<AllExperimental>, Hidden;
def Cplusplus : Package<"cplusplus">;
-def CplusplusExperimental : Package<"experimental">, InPackage<Cplusplus>, Hidden;
+def CplusplusExperimental : Package<"experimental">, InPackage<Cplusplus>,
+ InGroup<AllExperimental>, Hidden;
def DeadCode : Package<"deadcode">;
-def DeadCodeExperimental : Package<"experimental">, InPackage<DeadCode>, Hidden;
+def DeadCodeExperimental : Package<"experimental">, InPackage<DeadCode>,
+ InGroup<AllExperimental>, Hidden;
def Security : Package <"security">;
-def SecurityExperimental : Package<"experimental">, InPackage<Security>, Hidden;
+def SecurityExperimental : Package<"experimental">, InPackage<Security>,
+ InGroup<AllExperimental>, Hidden;
def Unix : Package<"unix">;
-def UnixExperimental : Package<"experimental">, InPackage<Unix>, Hidden;
+def UnixExperimental : Package<"experimental">, InPackage<Unix>,
+ InGroup<AllExperimental>, Hidden;
def OSX : Package<"osx">;
def Cocoa : Package<"cocoa">, InPackage<OSX>;
-def CocoaExperimental : Package<"experimental">, InPackage<Cocoa>, Hidden;
+def CocoaExperimental : Package<"experimental">, InPackage<Cocoa>,
+ InGroup<AllExperimental>, Hidden;
def CoreFoundation : Package<"coreFoundation">, InPackage<OSX>;
def LLVM : Package<"llvm">;
def Debug : Package<"debug">;
//===----------------------------------------------------------------------===//
-// Groups.
-//===----------------------------------------------------------------------===//
-
-def AllExperimental : CheckerGroup<"all-experimental">,
- Hidden;
-
-//===----------------------------------------------------------------------===//
// Core Checkers.
//===----------------------------------------------------------------------===//
@@ -88,32 +93,26 @@
let ParentPackage = CoreExperimental in {
def CastSizeChecker : Checker<"CastSize">,
- InGroup<AllExperimental>,
HelpText<"Check when casting a malloc'ed type T, whether the size is a multiple of the size of T">,
DescFile<"CastSizeChecker.cpp">;
def CastToStructChecker : Checker<"CastToStruct">,
- InGroup<AllExperimental>,
HelpText<"Check for cast from non-struct pointer to struct pointer">,
DescFile<"CastToStructChecker.cpp">;
def FixedAddressChecker : Checker<"FixedAddr">,
- InGroup<AllExperimental>,
HelpText<"Check for assignment of a fixed address to a pointer">,
DescFile<"FixedAddressChecker.cpp">;
def PointerArithChecker : Checker<"PointerArithm">,
- InGroup<AllExperimental>,
HelpText<"Check for pointer arithmetic on locations other than array elements">,
DescFile<"PointerArithChecker">;
def PointerSubChecker : Checker<"PointerSub">,
- InGroup<AllExperimental>,
HelpText<"Check for pointer subtractions on two pointers pointing to different memory chunks">,
DescFile<"PointerSubChecker">;
def SizeofPointerChecker : Checker<"SizeofPtr">,
- InGroup<AllExperimental>,
HelpText<"Warn about unintended use of sizeof() on pointer expressions">,
DescFile<"CheckSizeofPointer.cpp">;
@@ -170,12 +169,10 @@
let ParentPackage = CplusplusExperimental in {
def CStringChecker : Checker<"CString">,
- InGroup<AllExperimental>,
HelpText<"Check calls to functions in <string.h>">,
DescFile<"CStringChecker.cpp">;
def IteratorsChecker : Checker<"Iterators">,
- InGroup<AllExperimental>,
HelpText<"Check improper uses of STL vector iterators">,
DescFile<"IteratorsChecker.cpp">;
@@ -200,7 +197,6 @@
let ParentPackage = DeadCodeExperimental in {
def UnreachableCodeChecker : Checker<"UnreachableCode">,
- InGroup<AllExperimental>,
HelpText<"Check unreachable code">,
DescFile<"UnreachableCodeChecker.cpp">;
@@ -217,17 +213,14 @@
DescFile<"CheckSecuritySyntaxOnly.cpp">;
def ArrayBoundChecker : Checker<"ArrayBound">,
- InGroup<AllExperimental>,
HelpText<"Warn about buffer overflows (older checker)">,
DescFile<"ArrayBoundChecker.cpp">;
def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">,
- InGroup<AllExperimental>,
HelpText<"Warn about buffer overflows (newer checker)">,
DescFile<"ArrayBoundCheckerV2.cpp">;
def ReturnPointerRangeChecker : Checker<"ReturnPtrRange">,
- InGroup<AllExperimental>,
HelpText<"Check for an out-of-bound pointer being returned to callers">,
DescFile<"ReturnPointerRangeChecker.cpp">;
@@ -248,22 +241,18 @@
let ParentPackage = UnixExperimental in {
def ChrootChecker : Checker<"Chroot">,
- InGroup<AllExperimental>,
HelpText<"Check improper use of chroot">,
DescFile<"ChrootChecker.cpp">;
def MallocChecker : Checker<"Malloc">,
- InGroup<AllExperimental>,
HelpText<"Check for potential memory leaks, double free, and use-after-free problems">,
DescFile<"MallocChecker.cpp">;
def PthreadLockChecker : Checker<"PthreadLock">,
- InGroup<AllExperimental>,
HelpText<"Simple lock -> unlock checker">,
DescFile<"PthreadLockChecker.cpp">;
def StreamChecker : Checker<"Stream">,
- InGroup<AllExperimental>,
HelpText<"Check stream handling functions">,
DescFile<"StreamChecker.cpp">;
@@ -331,7 +320,6 @@
let ParentPackage = CocoaExperimental in {
def ObjCDeallocChecker : Checker<"Dealloc">,
- InGroup<AllExperimental>,
HelpText<"Warn about Objective-C classes that lack a correct implementation of -dealloc">,
DescFile<"CheckObjCDealloc.cpp">;
More information about the cfe-commits
mailing list