//===--- Checkers.td - Static Analyzer Checkers -===-----------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// include "CheckerBase.td" //===----------------------------------------------------------------------===// // Packages. //===----------------------------------------------------------------------===// // The Alpha package is for checkers that have too many false positives to be // turned on by default. The hierarchy under Alpha should be organized in the // hierarchy checkers would have had if they were truly at the top level. // (For example, a Cocoa-specific checker that is alpha should be in // alpha.osx.cocoa). def Alpha : Package<"alpha">; def Core : Package<"core">; def CoreBuiltin : Package<"builtin">, ParentPackage, Hidden; def CoreUninitialized : Package<"uninitialized">, ParentPackage; def CoreAlpha : Package<"core">, ParentPackage; // The OptIn package is for checkers that are not alpha and that would normally // be on by default but where the driver does not have enough information to // determine when they are applicable. For example, localizability checkers fit // this criterion because the driver cannot determine whether a project is // localized or not -- this is best determined at the IDE or build-system level. // // The checker hierarchy under OptIn should mirror that in Alpha: checkers // should be organized as if they were at the top level. // // Note: OptIn is *not* intended for checkers that are too noisy to be on by // default. Such checkers belong in the alpha package. def OptIn : Package<"optin">; // In the Portability package reside checkers for finding code that relies on // implementation-defined behavior. Such checks are wanted for cross-platform // development, but unwanted for developers who target only a single platform. def PortabilityOptIn : Package<"portability">, ParentPackage; def Nullability : Package<"nullability">, PackageOptions<[ CmdLineOption ]>; def Cplusplus : Package<"cplusplus">; def CplusplusAlpha : Package<"cplusplus">, ParentPackage; def CplusplusOptIn : Package<"cplusplus">, ParentPackage; def Valist : Package<"valist">; def DeadCode : Package<"deadcode">; def DeadCodeAlpha : Package<"deadcode">, ParentPackage; def Performance : Package<"performance">, ParentPackage; def Security : Package <"security">; def InsecureAPI : Package<"insecureAPI">, ParentPackage; def SecurityAlpha : Package<"security">, ParentPackage; def Taint : Package<"taint">, ParentPackage; def Unix : Package<"unix">; def UnixAlpha : Package<"unix">, ParentPackage; def CString : Package<"cstring">, ParentPackage; def CStringAlpha : Package<"cstring">, ParentPackage; def OSX : Package<"osx">; def OSXAlpha : Package<"osx">, ParentPackage; def OSXOptIn : Package<"osx">, ParentPackage; def Cocoa : Package<"cocoa">, ParentPackage; def CocoaAlpha : Package<"cocoa">, ParentPackage; def CocoaOptIn : Package<"cocoa">, ParentPackage; def CoreFoundation : Package<"coreFoundation">, ParentPackage; def Containers : Package<"containers">, ParentPackage; def LocalizabilityAlpha : Package<"localizability">, ParentPackage; def LocalizabilityOptIn : Package<"localizability">, ParentPackage; def MPI : Package<"mpi">, ParentPackage; def LLVM : Package<"llvm">; def LLVMAlpha : Package<"llvm">, ParentPackage; // The APIModeling package is for checkers that model APIs and don't perform // any diagnostics. These checkers are always turned on; this package is // intended for API modeling that is not controlled by the target triple. def APIModeling : Package<"apiModeling">, Hidden; def GoogleAPIModeling : Package<"google">, ParentPackage, Hidden; def LLVMAPIModeling : Package<"llvm">, ParentPackage, Hidden; def Debug : Package<"debug">, Hidden; def CloneDetectionAlpha : Package<"clone">, ParentPackage; def NonDeterminismAlpha : Package<"nondeterminism">, ParentPackage; //===----------------------------------------------------------------------===// // Core Checkers. //===----------------------------------------------------------------------===// let ParentPackage = Core in { def DereferenceChecker : Checker<"NullDereference">, HelpText<"Check for dereferences of null pointers">, Documentation; def CallAndMessageChecker : Checker<"CallAndMessage">, HelpText<"Check for logical errors for function calls and Objective-C " "message expressions (e.g., uninitialized arguments, null function " "pointers)">, Documentation; def NonNullParamChecker : Checker<"NonNullParamChecker">, HelpText<"Check for null pointers passed as arguments to a function whose " "arguments are references or marked with the 'nonnull' attribute">, Documentation; def VLASizeChecker : Checker<"VLASize">, HelpText<"Check for declarations of VLA of undefined or zero size">, Documentation; def DivZeroChecker : Checker<"DivideZero">, HelpText<"Check for division by zero">, Documentation; def UndefResultChecker : Checker<"UndefinedBinaryOperatorResult">, HelpText<"Check for undefined results of binary operators">, Documentation; def StackAddrEscapeBase : Checker<"StackAddrEscapeBase">, HelpText<"Generate information about stack address escapes.">, Documentation, Hidden; def StackAddrEscapeChecker : Checker<"StackAddressEscape">, HelpText<"Check that addresses to stack memory do not escape the function">, Dependencies<[StackAddrEscapeBase]>, Documentation; def DynamicTypePropagation : Checker<"DynamicTypePropagation">, HelpText<"Generate dynamic type information">, Documentation; def NonnullGlobalConstantsChecker: Checker<"NonnilStringConstants">, HelpText<"Assume that const string-like globals are non-null">, Documentation, Hidden; } // end "core" let ParentPackage = CoreAlpha in { def BoolAssignmentChecker : Checker<"BoolAssignment">, HelpText<"Warn about assigning non-{0,1} values to Boolean variables">, Documentation; def CastSizeChecker : Checker<"CastSize">, HelpText<"Check when casting a malloc'ed type T, whether the size is a " "multiple of the size of T">, Documentation; def CastToStructChecker : Checker<"CastToStruct">, HelpText<"Check for cast from non-struct pointer to struct pointer">, Documentation; def ConversionChecker : Checker<"Conversion">, HelpText<"Loss of sign/precision in implicit conversions">, Documentation; def IdenticalExprChecker : Checker<"IdenticalExpr">, HelpText<"Warn about unintended use of identical expressions in operators">, Documentation; def FixedAddressChecker : Checker<"FixedAddr">, HelpText<"Check for assignment of a fixed address to a pointer">, Documentation; def PointerArithChecker : Checker<"PointerArithm">, HelpText<"Check for pointer arithmetic on locations other than array " "elements">, Documentation; def PointerSubChecker : Checker<"PointerSub">, HelpText<"Check for pointer subtractions on two pointers pointing to " "different memory chunks">, Documentation; def SizeofPointerChecker : Checker<"SizeofPtr">, HelpText<"Warn about unintended use of sizeof() on pointer expressions">, Documentation; def CallAndMessageUnInitRefArg : Checker<"CallAndMessageUnInitRefArg">, HelpText<"Check for logical errors for function calls and Objective-C " "message expressions (e.g., uninitialized arguments, null function " "pointers, and pointer to undefined variables)">, Dependencies<[CallAndMessageChecker]>, Documentation; def TestAfterDivZeroChecker : Checker<"TestAfterDivZero">, HelpText<"Check for division by variable that is later compared against 0. " "Either the comparison is useless or there is division by zero.">, Documentation; def DynamicTypeChecker : Checker<"DynamicTypeChecker">, HelpText<"Check for cases where the dynamic and the static type of an object " "are unrelated.">, Documentation; def StackAddrAsyncEscapeChecker : Checker<"StackAddressAsyncEscape">, HelpText<"Check that addresses to stack memory do not escape the function">, Dependencies<[StackAddrEscapeBase]>, Documentation; } // end "alpha.core" //===----------------------------------------------------------------------===// // Nullability checkers. //===----------------------------------------------------------------------===// let ParentPackage = Nullability in { def NullabilityBase : Checker<"NullabilityBase">, HelpText<"Stores information during the analysis about nullability.">, Documentation, Hidden; def NullPassedToNonnullChecker : Checker<"NullPassedToNonnull">, HelpText<"Warns when a null pointer is passed to a pointer which has a " "_Nonnull type.">, Dependencies<[NullabilityBase]>, Documentation; def NullReturnedFromNonnullChecker : Checker<"NullReturnedFromNonnull">, HelpText<"Warns when a null pointer is returned from a function that has " "_Nonnull return type.">, Dependencies<[NullabilityBase]>, Documentation; def NullableDereferencedChecker : Checker<"NullableDereferenced">, HelpText<"Warns when a nullable pointer is dereferenced.">, Dependencies<[NullabilityBase]>, Documentation; def NullablePassedToNonnullChecker : Checker<"NullablePassedToNonnull">, HelpText<"Warns when a nullable pointer is passed to a pointer which has a " "_Nonnull type.">, Dependencies<[NullabilityBase]>, Documentation; def NullableReturnedFromNonnullChecker : Checker<"NullableReturnedFromNonnull">, HelpText<"Warns when a nullable pointer is returned from a function that has " "_Nonnull return type.">, Dependencies<[NullabilityBase]>, Documentation; } // end "nullability" //===----------------------------------------------------------------------===// // APIModeling. //===----------------------------------------------------------------------===// let ParentPackage = APIModeling in { def StdCLibraryFunctionsChecker : Checker<"StdCLibraryFunctions">, HelpText<"Improve modeling of the C standard library functions">, Documentation; def TrustNonnullChecker : Checker<"TrustNonnull">, HelpText<"Trust that returns from framework methods annotated with _Nonnull " "are not null">, Documentation; } // end "apiModeling" //===----------------------------------------------------------------------===// // Evaluate "builtin" functions. //===----------------------------------------------------------------------===// let ParentPackage = CoreBuiltin in { def NoReturnFunctionChecker : Checker<"NoReturnFunctions">, HelpText<"Evaluate \"panic\" functions that are known to not return to the " "caller">, Documentation; def BuiltinFunctionChecker : Checker<"BuiltinFunctions">, HelpText<"Evaluate compiler builtin functions (e.g., alloca())">, Documentation; } // end "core.builtin" //===----------------------------------------------------------------------===// // Uninitialized values checkers. //===----------------------------------------------------------------------===// let ParentPackage = CoreUninitialized in { def UndefinedArraySubscriptChecker : Checker<"ArraySubscript">, HelpText<"Check for uninitialized values used as array subscripts">, Documentation; def UndefinedAssignmentChecker : Checker<"Assign">, HelpText<"Check for assigning uninitialized values">, Documentation; def UndefBranchChecker : Checker<"Branch">, HelpText<"Check for uninitialized values used as branch conditions">, Documentation; def UndefCapturedBlockVarChecker : Checker<"CapturedBlockVariable">, HelpText<"Check for blocks that capture uninitialized values">, Documentation; def ReturnUndefChecker : Checker<"UndefReturn">, HelpText<"Check for uninitialized values being returned to the caller">, Documentation; } // end "core.uninitialized" //===----------------------------------------------------------------------===// // Unix API checkers. //===----------------------------------------------------------------------===// let ParentPackage = CString in { def CStringModeling : Checker<"CStringModeling">, HelpText<"The base of several CString related checkers. On it's own it emits " "no reports, but adds valuable information to the analysis when " "enabled.">, Documentation, Hidden; def CStringNullArg : Checker<"NullArg">, HelpText<"Check for null pointers being passed as arguments to C string " "functions">, Dependencies<[CStringModeling]>, Documentation; def CStringSyntaxChecker : Checker<"BadSizeArg">, HelpText<"Check the size argument passed into C string functions for common " "erroneous patterns">, Dependencies<[CStringModeling]>, Documentation; } // end "unix.cstring" let ParentPackage = CStringAlpha in { def CStringOutOfBounds : Checker<"OutOfBounds">, HelpText<"Check for out-of-bounds access in string functions">, Dependencies<[CStringModeling]>, Documentation; def CStringBufferOverlap : Checker<"BufferOverlap">, HelpText<"Checks for overlap in two buffer arguments">, Dependencies<[CStringModeling]>, Documentation; def CStringNotNullTerm : Checker<"NotNullTerminated">, HelpText<"Check for arguments which are not null-terminating strings">, Dependencies<[CStringModeling]>, Documentation; } // end "alpha.unix.cstring" let ParentPackage = Unix in { def UnixAPIMisuseChecker : Checker<"API">, HelpText<"Check calls to various UNIX/Posix functions">, Documentation; def DynamicMemoryModeling: Checker<"DynamicMemoryModeling">, HelpText<"The base of several malloc() related checkers. On it's own it " "emits no reports, but adds valuable information to the analysis " "when enabled.">, CheckerOptions<[ CmdLineOption ]>, Dependencies<[CStringModeling]>, Documentation, Hidden; def MallocChecker: Checker<"Malloc">, HelpText<"Check for memory leaks, double free, and use-after-free problems. " "Traces memory managed by malloc()/free().">, Dependencies<[DynamicMemoryModeling]>, Documentation; def MallocSizeofChecker : Checker<"MallocSizeof">, HelpText<"Check for dubious malloc arguments involving sizeof">, Documentation; def MismatchedDeallocatorChecker : Checker<"MismatchedDeallocator">, HelpText<"Check for mismatched deallocators.">, Dependencies<[DynamicMemoryModeling]>, Documentation; def VforkChecker : Checker<"Vfork">, HelpText<"Check for proper usage of vfork">, Documentation; } // end "unix" let ParentPackage = UnixAlpha in { def ChrootChecker : Checker<"Chroot">, HelpText<"Check improper use of chroot">, Documentation; def PthreadLockChecker : Checker<"PthreadLock">, HelpText<"Simple lock -> unlock checker">, Documentation; def StreamChecker : Checker<"Stream">, HelpText<"Check stream handling functions">, Documentation; def SimpleStreamChecker : Checker<"SimpleStream">, HelpText<"Check for misuses of stream APIs">, Documentation; def BlockInCriticalSectionChecker : Checker<"BlockInCriticalSection">, HelpText<"Check for calls to blocking functions inside a critical section">, Documentation; } // end "alpha.unix" //===----------------------------------------------------------------------===// // C++ checkers. //===----------------------------------------------------------------------===// let ParentPackage = Cplusplus in { def InnerPointerChecker : Checker<"InnerPointer">, HelpText<"Check for inner pointers of C++ containers used after " "re/deallocation">, Dependencies<[DynamicMemoryModeling]>, Documentation; def NewDeleteChecker : Checker<"NewDelete">, HelpText<"Check for double-free and use-after-free problems. Traces memory " "managed by new/delete.">, Dependencies<[DynamicMemoryModeling]>, Documentation; def NewDeleteLeaksChecker : Checker<"NewDeleteLeaks">, HelpText<"Check for memory leaks. Traces memory managed by new/delete.">, Dependencies<[NewDeleteChecker]>, Documentation; def CXXSelfAssignmentChecker : Checker<"SelfAssignment">, HelpText<"Checks C++ copy and move assignment operators for self assignment">, Documentation, Hidden; def SmartPtrModeling: Checker<"SmartPtr">, HelpText<"Model behavior of C++ smart pointers">, Documentation, Hidden; def MoveChecker: Checker<"Move">, HelpText<"Find use-after-move bugs in C++">, CheckerOptions<[ CmdLineOption ]>, Documentation; def VirtualCallModeling : Checker<"VirtualCallModeling">, HelpText<"Auxiliary modeling for the virtual method call checkers">, Documentation, Hidden; def PureVirtualCallChecker : Checker<"PureVirtualCall">, HelpText<"Check pure virtual function calls during construction/destruction">, Dependencies<[VirtualCallModeling]>, Documentation; } // end: "cplusplus" let ParentPackage = CplusplusOptIn in { def UninitializedObjectChecker: Checker<"UninitializedObject">, HelpText<"Reports uninitialized fields after object construction">, CheckerOptions<[ CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption ]>, Documentation; def VirtualCallChecker : Checker<"VirtualCall">, HelpText<"Check virtual function calls during construction/destruction">, CheckerOptions<[ CmdLineOption, CmdLineOption ]>, Dependencies<[VirtualCallModeling]>, Documentation; } // end: "optin.cplusplus" let ParentPackage = CplusplusAlpha in { def DeleteWithNonVirtualDtorChecker : Checker<"DeleteWithNonVirtualDtor">, HelpText<"Reports destructions of polymorphic objects with a non-virtual " "destructor in their base class">, Documentation; def EnumCastOutOfRangeChecker : Checker<"EnumCastOutOfRange">, HelpText<"Check integer to enumeration casts for out of range values">, Documentation; def IteratorModeling : Checker<"IteratorModeling">, HelpText<"Models iterators of C++ containers">, Documentation, Hidden; def InvalidatedIteratorChecker : Checker<"InvalidatedIterator">, HelpText<"Check for use of invalidated iterators">, Dependencies<[IteratorModeling]>, Documentation; def IteratorRangeChecker : Checker<"IteratorRange">, HelpText<"Check for iterators used outside their valid ranges">, Dependencies<[IteratorModeling]>, Documentation; def MismatchedIteratorChecker : Checker<"MismatchedIterator">, HelpText<"Check for use of iterators of different containers where iterators " "of the same container are expected">, Dependencies<[IteratorModeling]>, Documentation; } // end: "alpha.cplusplus" //===----------------------------------------------------------------------===// // Valist checkers. //===----------------------------------------------------------------------===// let ParentPackage = Valist in { def ValistBase : Checker<"ValistBase">, HelpText<"Gathers information about va_lists.">, Documentation, Hidden; def UninitializedChecker : Checker<"Uninitialized">, HelpText<"Check for usages of uninitialized (or already released) va_lists.">, Dependencies<[ValistBase]>, Documentation; def UnterminatedChecker : Checker<"Unterminated">, HelpText<"Check for va_lists which are not released by a va_end call.">, Dependencies<[ValistBase]>, Documentation; def CopyToSelfChecker : Checker<"CopyToSelf">, HelpText<"Check for va_lists which are copied onto itself.">, Dependencies<[ValistBase]>, Documentation; } // end : "valist" //===----------------------------------------------------------------------===// // Deadcode checkers. //===----------------------------------------------------------------------===// let ParentPackage = DeadCode in { def DeadStoresChecker : Checker<"DeadStores">, HelpText<"Check for values stored to variables that are never read " "afterwards">, CheckerOptions<[ CmdLineOption, CmdLineOption ]>, Documentation; } // end DeadCode let ParentPackage = DeadCodeAlpha in { def UnreachableCodeChecker : Checker<"UnreachableCode">, HelpText<"Check unreachable code">, Documentation; } // end "alpha.deadcode" //===----------------------------------------------------------------------===// // Performance checkers. //===----------------------------------------------------------------------===// let ParentPackage = Performance in { def PaddingChecker : Checker<"Padding">, HelpText<"Check for excessively padded structs.">, CheckerOptions<[ CmdLineOption ]>, Documentation; } // end: "padding" //===----------------------------------------------------------------------===// // Security checkers. //===----------------------------------------------------------------------===// let ParentPackage = InsecureAPI in { def SecuritySyntaxChecker : Checker<"SecuritySyntaxChecker">, HelpText<"Base of various security function related checkers">, Documentation, Hidden; def bcmp : Checker<"bcmp">, HelpText<"Warn on uses of the 'bcmp' function">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def bcopy : Checker<"bcopy">, HelpText<"Warn on uses of the 'bcopy' function">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def bzero : Checker<"bzero">, HelpText<"Warn on uses of the 'bzero' function">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def gets : Checker<"gets">, HelpText<"Warn on uses of the 'gets' function">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def getpw : Checker<"getpw">, HelpText<"Warn on uses of the 'getpw' function">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def mktemp : Checker<"mktemp">, HelpText<"Warn on uses of the 'mktemp' function">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def mkstemp : Checker<"mkstemp">, HelpText<"Warn when 'mkstemp' is passed fewer than 6 X's in the format " "string">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def rand : Checker<"rand">, HelpText<"Warn on uses of the 'rand', 'random', and related functions">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def strcpy : Checker<"strcpy">, HelpText<"Warn on uses of the 'strcpy' and 'strcat' functions">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def vfork : Checker<"vfork">, HelpText<"Warn on uses of the 'vfork' function">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def UncheckedReturn : Checker<"UncheckedReturn">, HelpText<"Warn on uses of functions whose return values must be always " "checked">, Dependencies<[SecuritySyntaxChecker]>, Documentation; def DeprecatedOrUnsafeBufferHandling : Checker<"DeprecatedOrUnsafeBufferHandling">, HelpText<"Warn on uses of unsecure or deprecated buffer manipulating " "functions">, Dependencies<[SecuritySyntaxChecker]>, Documentation; } // end "security.insecureAPI" let ParentPackage = Security in { def FloatLoopCounter : Checker<"FloatLoopCounter">, HelpText<"Warn on using a floating point value as a loop counter (CERT: " "FLP30-C, FLP30-CPP)">, Dependencies<[SecuritySyntaxChecker]>, Documentation; } // end "security" let ParentPackage = SecurityAlpha in { def ArrayBoundChecker : Checker<"ArrayBound">, HelpText<"Warn about buffer overflows (older checker)">, Documentation; def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">, HelpText<"Warn about buffer overflows (newer checker)">, Documentation; def ReturnPointerRangeChecker : Checker<"ReturnPtrRange">, HelpText<"Check for an out-of-bound pointer being returned to callers">, Documentation; def MallocOverflowSecurityChecker : Checker<"MallocOverflow">, HelpText<"Check for overflows in the arguments to malloc()">, Documentation; def MmapWriteExecChecker : Checker<"MmapWriteExec">, HelpText<"Warn on mmap() calls that are both writable and executable">, CheckerOptions<[ CmdLineOption, CmdLineOption ]>, Documentation; } // end "alpha.security" //===----------------------------------------------------------------------===// // Taint checkers. //===----------------------------------------------------------------------===// let ParentPackage = Taint in { def GenericTaintChecker : Checker<"TaintPropagation">, HelpText<"Generate taint information used by other checkers">, CheckerOptions<[ CmdLineOption, ]>, Documentation; } // end "alpha.security.taint" //===----------------------------------------------------------------------===// // Mac OS X, Cocoa, and Core Foundation checkers. //===----------------------------------------------------------------------===// let ParentPackage = Cocoa in { def RetainCountBase : Checker<"RetainCountBase">, HelpText<"Common base of various retain count related checkers">, Documentation, Hidden; } // end "osx.cocoa" let ParentPackage = OSX in { def NSOrCFErrorDerefChecker : Checker<"NSOrCFErrorDerefChecker">, HelpText<"Implementation checker for NSErrorChecker and CFErrorChecker">, Documentation, Hidden; def NumberObjectConversionChecker : Checker<"NumberObjectConversion">, HelpText<"Check for erroneous conversions of objects representing numbers " "into numbers">, CheckerOptions<[ CmdLineOption ]>, Documentation; def MacOSXAPIChecker : Checker<"API">, HelpText<"Check for proper uses of various Apple APIs">, Documentation; def MacOSKeychainAPIChecker : Checker<"SecKeychainAPI">, HelpText<"Check for proper uses of Secure Keychain APIs">, Documentation; def MIGChecker : Checker<"MIG">, HelpText<"Find violations of the Mach Interface Generator " "calling convention">, Documentation; def ObjCPropertyChecker : Checker<"ObjCProperty">, HelpText<"Check for proper uses of Objective-C properties">, Documentation; def OSObjectRetainCountChecker : Checker<"OSObjectRetainCount">, HelpText<"Check for leaks and improper reference count management for " "OSObject">, Dependencies<[RetainCountBase]>, Documentation; } // end "osx" let ParentPackage = Cocoa in { def RunLoopAutoreleaseLeakChecker : Checker<"RunLoopAutoreleaseLeak">, HelpText<"Check for leaked memory in autorelease pools that will never be " "drained">, Documentation; def ObjCAtSyncChecker : Checker<"AtSync">, HelpText<"Check for nil pointers used as mutexes for @synchronized">, Documentation; def NilArgChecker : Checker<"NilArg">, HelpText<"Check for prohibited nil arguments to ObjC method calls">, Documentation; def ClassReleaseChecker : Checker<"ClassRelease">, HelpText<"Check for sending 'retain', 'release', or 'autorelease' directly " "to a Class">, Documentation; def VariadicMethodTypeChecker : Checker<"VariadicMethodTypes">, HelpText<"Check for passing non-Objective-C types to variadic collection " "initialization methods that expect only Objective-C types">, Documentation; def NSAutoreleasePoolChecker : Checker<"NSAutoreleasePool">, HelpText<"Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC " "mode">, Documentation; def ObjCMethSigsChecker : Checker<"IncompatibleMethodTypes">, HelpText<"Warn about Objective-C method signatures with type " "incompatibilities">, Documentation; def ObjCUnusedIvarsChecker : Checker<"UnusedIvars">, HelpText<"Warn about private ivars that are never used">, Documentation; def ObjCSelfInitChecker : Checker<"SelfInit">, HelpText<"Check that 'self' is properly initialized inside an initializer " "method">, Documentation; def ObjCLoopChecker : Checker<"Loops">, HelpText<"Improved modeling of loops using Cocoa collection types">, Documentation; def ObjCNonNilReturnValueChecker : Checker<"NonNilReturnValue">, HelpText<"Model the APIs that are guaranteed to return a non-nil value">, Documentation; def ObjCSuperCallChecker : Checker<"MissingSuperCall">, HelpText<"Warn about Objective-C methods that lack a necessary call to " "super">, Documentation; def NSErrorChecker : Checker<"NSError">, HelpText<"Check usage of NSError** parameters">, Dependencies<[NSOrCFErrorDerefChecker]>, Documentation; def RetainCountChecker : Checker<"RetainCount">, HelpText<"Check for leaks and improper reference count management">, CheckerOptions<[ CmdLineOption, CmdLineOption ]>, Dependencies<[RetainCountBase]>, Documentation; def ObjCGenericsChecker : Checker<"ObjCGenerics">, HelpText<"Check for type errors when using Objective-C generics">, Dependencies<[DynamicTypePropagation]>, Documentation; def ObjCDeallocChecker : Checker<"Dealloc">, HelpText<"Warn about Objective-C classes that lack a correct implementation " "of -dealloc">, Documentation; def ObjCSuperDeallocChecker : Checker<"SuperDealloc">, HelpText<"Warn about improper use of '[super dealloc]' in Objective-C">, Documentation; def AutoreleaseWriteChecker : Checker<"AutoreleaseWrite">, HelpText<"Warn about potentially crashing writes to autoreleasing objects " "from different autoreleasing pools in Objective-C">, Documentation; } // end "osx.cocoa" let ParentPackage = Performance in { def GCDAntipattern : Checker<"GCDAntipattern">, HelpText<"Check for performance anti-patterns when using Grand Central " "Dispatch">, Documentation; } // end "optin.performance" let ParentPackage = OSXOptIn in { def OSObjectCStyleCast : Checker<"OSObjectCStyleCast">, HelpText<"Checker for C-style casts of OSObjects">, Documentation; } // end "optin.osx" let ParentPackage = CocoaAlpha in { def IvarInvalidationModeling : Checker<"IvarInvalidationModeling">, HelpText<"Gathers information for annotation driven invalidation checking " "for classes that contains a method annotated with " "'objc_instance_variable_invalidator'">, Documentation, Hidden; def InstanceVariableInvalidation : Checker<"InstanceVariableInvalidation">, HelpText<"Check that the invalidatable instance variables are invalidated in " "the methods annotated with objc_instance_variable_invalidator">, Dependencies<[IvarInvalidationModeling]>, Documentation; def MissingInvalidationMethod : Checker<"MissingInvalidationMethod">, HelpText<"Check that the invalidation methods are present in classes that " "contain invalidatable instance variables">, Dependencies<[IvarInvalidationModeling]>, Documentation; def DirectIvarAssignment : Checker<"DirectIvarAssignment">, HelpText<"Check for direct assignments to instance variables">, Documentation; def DirectIvarAssignmentForAnnotatedFunctions : Checker<"DirectIvarAssignmentForAnnotatedFunctions">, HelpText<"Check for direct assignments to instance variables in the methods " "annotated with objc_no_direct_instance_variable_assignment">, Dependencies<[DirectIvarAssignment]>, Documentation; } // end "alpha.osx.cocoa" let ParentPackage = CoreFoundation in { def CFNumberChecker : Checker<"CFNumber">, HelpText<"Check for proper uses of CFNumber APIs">, Documentation; def CFRetainReleaseChecker : Checker<"CFRetainRelease">, HelpText<"Check for null arguments to CFRetain/CFRelease/CFMakeCollectable">, Documentation; def CFErrorChecker : Checker<"CFError">, HelpText<"Check usage of CFErrorRef* parameters">, Dependencies<[NSOrCFErrorDerefChecker]>, Documentation; } // end "osx.coreFoundation" let ParentPackage = Containers in { def ObjCContainersASTChecker : Checker<"PointerSizedValues">, HelpText<"Warns if 'CFArray', 'CFDictionary', 'CFSet' are created with " "non-pointer-size values">, Documentation; def ObjCContainersChecker : Checker<"OutOfBounds">, HelpText<"Checks for index out-of-bounds when using 'CFArray' API">, Documentation; } // end "osx.coreFoundation.containers" let ParentPackage = LocalizabilityOptIn in { def NonLocalizedStringChecker : Checker<"NonLocalizedStringChecker">, HelpText<"Warns about uses of non-localized NSStrings passed to UI methods " "expecting localized NSStrings">, CheckerOptions<[ CmdLineOption ]>, Documentation; def EmptyLocalizationContextChecker : Checker<"EmptyLocalizationContextChecker">, HelpText<"Check that NSLocalizedString macros include a comment for context">, Documentation; } // end "optin.osx.cocoa.localizability" let ParentPackage = LocalizabilityAlpha in { def PluralMisuseChecker : Checker<"PluralMisuseChecker">, HelpText<"Warns against using one vs. many plural pattern in code when " "generating localized strings.">, Documentation; } // end "alpha.osx.cocoa.localizability" let ParentPackage = MPI in { def MPIChecker : Checker<"MPI-Checker">, HelpText<"Checks MPI code">, Documentation; } // end "optin.mpi" //===----------------------------------------------------------------------===// // Checkers for LLVM development. //===----------------------------------------------------------------------===// let ParentPackage = LLVMAlpha in { def LLVMConventionsChecker : Checker<"Conventions">, HelpText<"Check code for LLVM codebase conventions">, Documentation; } // end "llvm" let ParentPackage = LLVMAPIModeling in { def CastValueChecker : Checker<"CastValue">, HelpText<"Model implementation of custom RTTIs">, Documentation; def ReturnValueChecker : Checker<"ReturnValue">, HelpText<"Model the guaranteed boolean return value of function calls">, Documentation; } // end "apiModeling.llvm" //===----------------------------------------------------------------------===// // Checkers modeling Google APIs. //===----------------------------------------------------------------------===// let ParentPackage = GoogleAPIModeling in { def GTestChecker : Checker<"GTest">, HelpText<"Model gtest assertion APIs">, Documentation; } // end "apiModeling.google" //===----------------------------------------------------------------------===// // Debugging checkers (for analyzer development). //===----------------------------------------------------------------------===// let ParentPackage = Debug in { def AnalysisOrderChecker : Checker<"AnalysisOrder">, HelpText<"Print callbacks that are called during analysis in order">, CheckerOptions<[ CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption, CmdLineOption ]>, Documentation; def DominatorsTreeDumper : Checker<"DumpDominators">, HelpText<"Print the dominance tree for a given CFG">, Documentation; def PostDominatorsTreeDumper : Checker<"DumpPostDominators">, HelpText<"Print the post dominance tree for a given CFG">, Documentation; def ControlDependencyTreeDumper : Checker<"DumpControlDependencies">, HelpText<"Print the post control dependency tree for a given CFG">, Documentation; def LiveVariablesDumper : Checker<"DumpLiveVars">, HelpText<"Print results of live variable analysis">, Documentation; def LiveStatementsDumper : Checker<"DumpLiveStmts">, HelpText<"Print results of live statement analysis">, Documentation; def CFGViewer : Checker<"ViewCFG">, HelpText<"View Control-Flow Graphs using GraphViz">, Documentation; def CFGDumper : Checker<"DumpCFG">, HelpText<"Display Control-Flow Graphs">, Documentation; def CallGraphViewer : Checker<"ViewCallGraph">, HelpText<"View Call Graph using GraphViz">, Documentation; def CallGraphDumper : Checker<"DumpCallGraph">, HelpText<"Display Call Graph">, Documentation; def ConfigDumper : Checker<"ConfigDumper">, HelpText<"Dump config table">, Documentation; def TraversalDumper : Checker<"DumpTraversal">, HelpText<"Print branch conditions as they are traversed by the engine">, Documentation; def CallDumper : Checker<"DumpCalls">, HelpText<"Print calls as they are traversed by the engine">, Documentation; def AnalyzerStatsChecker : Checker<"Stats">, HelpText<"Emit warnings with analyzer statistics">, Documentation; def TaintTesterChecker : Checker<"TaintTest">, HelpText<"Mark tainted symbols as such.">, Documentation; def ExprInspectionChecker : Checker<"ExprInspection">, HelpText<"Check the analyzer's understanding of expressions">, Documentation; def ExplodedGraphViewer : Checker<"ViewExplodedGraph">, HelpText<"View Exploded Graphs using GraphViz">, Documentation; def ReportStmts : Checker<"ReportStmts">, HelpText<"Emits a warning for every statement.">, Documentation; } // end "debug" //===----------------------------------------------------------------------===// // Clone Detection //===----------------------------------------------------------------------===// let ParentPackage = CloneDetectionAlpha in { def CloneChecker : Checker<"CloneChecker">, HelpText<"Reports similar pieces of code.">, CheckerOptions<[ CmdLineOption, CmdLineOption, CmdLineOption ]>, Documentation; } // end "clone" //===----------------------------------------------------------------------===// // Portability checkers. //===----------------------------------------------------------------------===// let ParentPackage = PortabilityOptIn in { def UnixAPIPortabilityChecker : Checker<"UnixAPI">, HelpText<"Finds implementation-defined behavior in UNIX/Posix functions">, Documentation; } // end optin.portability //===----------------------------------------------------------------------===// // NonDeterminism checkers. //===----------------------------------------------------------------------===// let ParentPackage = NonDeterminismAlpha in { def PointerIterationChecker : Checker<"PointerIteration">, HelpText<"Checks for non-determinism caused by iteration of unordered containers of pointers">, Documentation; def PointerSortingChecker : Checker<"PointerSorting">, HelpText<"Check for non-determinism caused by sorting of pointers">, Documentation; } // end alpha.nondeterminism