2011-02-15 02:13:31 +08:00
|
|
|
//===--- Checkers.td - Static Analyzer Checkers -===-----------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
include "clang/StaticAnalyzer/Checkers/CheckerBase.td"
|
|
|
|
|
2011-02-16 05:25:03 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Packages.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2011-02-15 15:42:33 +08:00
|
|
|
def Core : Package<"core">;
|
2011-02-15 02:13:31 +08:00
|
|
|
def Cocoa : Package<"cocoa">;
|
2011-02-15 15:42:33 +08:00
|
|
|
def Unix : Package<"unix">;
|
|
|
|
def MacOSX : Package<"macosx">;
|
|
|
|
|
2011-02-16 05:25:03 +08:00
|
|
|
def CoreExperimental : Package<"experimental">,
|
|
|
|
InPackage<Core>, Hidden;
|
|
|
|
|
|
|
|
def UnixExperimental : Package<"experimental">,
|
|
|
|
InPackage<Unix>, Hidden;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Groups.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def AllExperimental : CheckerGroup<"all-experimental">,
|
|
|
|
Hidden;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Checkers.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2011-02-15 15:42:33 +08:00
|
|
|
let ParentPackage = Cocoa in {
|
2011-02-15 02:13:31 +08:00
|
|
|
|
2011-02-15 15:42:38 +08:00
|
|
|
def ObjCSelfInitChecker : Checker<"SelfInit">,
|
2011-02-15 02:13:31 +08:00
|
|
|
HelpText<"Check that 'self' is propely initialized inside an initializer method">,
|
|
|
|
DescFile<"ObjCSelfInitChecker.cpp">;
|
2011-02-15 15:42:33 +08:00
|
|
|
|
2011-02-15 15:42:38 +08:00
|
|
|
def ObjCAtSyncChecker : Checker<"AtSync">,
|
2011-02-15 15:42:33 +08:00
|
|
|
HelpText<"Check for null pointers used as mutexes for @synchronized">,
|
|
|
|
DescFile<"ObjCAtSyncChecker.cpp">;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-02-15 15:42:38 +08:00
|
|
|
def StackAddrLeakChecker : Checker<"StackAddrLeak">,
|
2011-02-15 15:42:33 +08:00
|
|
|
InPackage<Core>,
|
|
|
|
HelpText<"Check that addresses to stack memory are not leaked outside the function">,
|
|
|
|
DescFile<"StackAddrLeakChecker.cpp">;
|
|
|
|
|
2011-02-15 15:42:38 +08:00
|
|
|
def UnixAPIChecker : Checker<"API">,
|
2011-02-15 15:42:33 +08:00
|
|
|
InPackage<Unix>,
|
|
|
|
HelpText<"Check calls to various UNIX/Posix functions">,
|
|
|
|
DescFile<"UnixAPIChecker.cpp">;
|
|
|
|
|
2011-02-15 15:42:38 +08:00
|
|
|
def MacOSXAPIChecker : Checker<"API">,
|
2011-02-15 15:42:33 +08:00
|
|
|
InPackage<MacOSX>,
|
|
|
|
HelpText<"Check calls to various MacOSXAPIChecker">,
|
|
|
|
DescFile<"MacOSXAPIChecker.cpp">;
|
2011-02-16 05:25:03 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Hidden experimental checkers.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
let Group = AllExperimental in {
|
|
|
|
|
|
|
|
def CStringChecker : Checker<"CString">,
|
|
|
|
InPackage<CoreExperimental>,
|
|
|
|
HelpText<"Check calls to functions in <string.h>">,
|
|
|
|
DescFile<"CStringChecker.cpp">;
|
|
|
|
|
|
|
|
def UnreachableCodeChecker : Checker<"UnreachableCode">,
|
|
|
|
InPackage<CoreExperimental>,
|
|
|
|
HelpText<"Check unreachable code">,
|
|
|
|
DescFile<"UnreachableCodeChecker.cpp">;
|
|
|
|
|
2011-02-16 06:55:14 +08:00
|
|
|
def IdempotentOperationChecker : Checker<"IdempotentOps">,
|
|
|
|
InPackage<CoreExperimental>,
|
|
|
|
HelpText<"Warn about idempotent operations">,
|
|
|
|
DescFile<"IdempotentOperationChecker.cpp">;
|
|
|
|
|
2011-02-16 06:55:20 +08:00
|
|
|
def CastToStructChecker : Checker<"CastToStruct">,
|
|
|
|
InPackage<CoreExperimental>,
|
|
|
|
HelpText<"Check for cast from non-struct pointer to struct pointer">,
|
|
|
|
DescFile<"CastToStructChecker.cpp">;
|
|
|
|
|
|
|
|
def FixedAddressChecker : Checker<"FixedAddr">,
|
|
|
|
InPackage<CoreExperimental>,
|
|
|
|
HelpText<"Check for assignment of a fixed address to a pointer">,
|
|
|
|
DescFile<"FixedAddressChecker.cpp">;
|
|
|
|
|
|
|
|
def PointerArithChecker : Checker<"PointerArithm">,
|
|
|
|
InPackage<CoreExperimental>,
|
|
|
|
HelpText<"Check for pointer arithmetic on locations other than array elements">,
|
|
|
|
DescFile<"PointerArithChecker">;
|
|
|
|
|
|
|
|
def PointerSubChecker : Checker<"PointerSub">,
|
|
|
|
InPackage<CoreExperimental>,
|
|
|
|
HelpText<"Check for pointer subtractions on two pointers pointing to different memory chunks">,
|
|
|
|
DescFile<"PointerSubChecker">;
|
|
|
|
|
2011-02-16 05:25:03 +08:00
|
|
|
def ChrootChecker : Checker<"Chroot">,
|
|
|
|
InPackage<UnixExperimental>,
|
|
|
|
HelpText<"Check improper use of chroot">,
|
|
|
|
DescFile<"ChrootChecker.cpp">;
|
|
|
|
|
|
|
|
def PthreadLockChecker : Checker<"PthreadLock">,
|
|
|
|
InPackage<UnixExperimental>,
|
|
|
|
HelpText<"Simple lock -> unlock checker">,
|
|
|
|
DescFile<"PthreadLockChecker.cpp">;
|
|
|
|
|
|
|
|
def StreamChecker : Checker<"Stream">,
|
|
|
|
InPackage<UnixExperimental>,
|
|
|
|
HelpText<"Check stream handling functions">,
|
|
|
|
DescFile<"StreamChecker.cpp">;
|
|
|
|
|
|
|
|
}
|