1//===--- Checkers.td - Static Analyzer Checkers -===-----------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10include "clang/StaticAnalyzer/Checkers/CheckerBase.td" 11 12//===----------------------------------------------------------------------===// 13// Packages. 14//===----------------------------------------------------------------------===// 15 16// The Alpha package is for checkers that have too many false positives to be 17// turned on by default. The hierarchy under Alpha should be organized in the 18// hierarchy checkers would have had if they were truly at the top level. 19// (For example, a Cocoa-specific checker that is alpha should be in 20// alpha.osx.cocoa). 21def Alpha : Package<"alpha">; 22 23def Core : Package<"core">; 24def CoreBuiltin : Package<"builtin">, InPackage<Core>; 25def CoreUninitialized : Package<"uninitialized">, InPackage<Core>; 26def CoreAlpha : Package<"core">, InPackage<Alpha>, Hidden; 27 28// The OptIn package is for checkers that are not alpha and that would normally 29// be on by default but where the driver does not have enough information to 30// determine when they are applicable. For example, localizability checkers fit 31// this criterion because the driver cannot determine whether a project is 32// localized or not -- this is best determined at the IDE or build-system level. 33// 34// The checker hierarchy under OptIn should mirror that in Alpha: checkers 35// should be organized as if they were at the top level. 36// 37// Note: OptIn is *not* intended for checkers that are too noisy to be on by 38// default. Such checkers belong in the alpha package. 39def OptIn : Package<"optin">; 40 41def Nullability : Package<"nullability">; 42 43def Cplusplus : Package<"cplusplus">; 44def CplusplusAlpha : Package<"cplusplus">, InPackage<Alpha>, Hidden; 45 46def DeadCode : Package<"deadcode">; 47def DeadCodeAlpha : Package<"deadcode">, InPackage<Alpha>, Hidden; 48 49def Performance : Package<"performance">, InPackage<OptIn>; 50 51def Security : Package <"security">; 52def InsecureAPI : Package<"insecureAPI">, InPackage<Security>; 53def SecurityAlpha : Package<"security">, InPackage<Alpha>, Hidden; 54def Taint : Package<"taint">, InPackage<SecurityAlpha>, Hidden; 55 56def Unix : Package<"unix">; 57def UnixAlpha : Package<"unix">, InPackage<Alpha>, Hidden; 58def CString : Package<"cstring">, InPackage<Unix>, Hidden; 59def CStringAlpha : Package<"cstring">, InPackage<UnixAlpha>, Hidden; 60 61def OSX : Package<"osx">; 62def OSXAlpha : Package<"osx">, InPackage<Alpha>, Hidden; 63def OSXOptIn : Package<"osx">, InPackage<OptIn>; 64 65def Cocoa : Package<"cocoa">, InPackage<OSX>; 66def CocoaAlpha : Package<"cocoa">, InPackage<OSXAlpha>, Hidden; 67def CocoaOptIn : Package<"cocoa">, InPackage<OSXOptIn>; 68 69def CoreFoundation : Package<"coreFoundation">, InPackage<OSX>; 70def Containers : Package<"containers">, InPackage<CoreFoundation>; 71 72def LocalizabilityAlpha : Package<"localizability">, InPackage<CocoaAlpha>; 73def LocalizabilityOptIn : Package<"localizability">, InPackage<CocoaOptIn>; 74 75def LLVM : Package<"llvm">; 76def Debug : Package<"debug">; 77 78//===----------------------------------------------------------------------===// 79// Core Checkers. 80//===----------------------------------------------------------------------===// 81 82let ParentPackage = Core in { 83 84def DereferenceChecker : Checker<"NullDereference">, 85 HelpText<"Check for dereferences of null pointers">, 86 DescFile<"DereferenceChecker.cpp">; 87 88def CallAndMessageChecker : Checker<"CallAndMessage">, 89 HelpText<"Check for logical errors for function calls and Objective-C message expressions (e.g., uninitialized arguments, null function pointers)">, 90 DescFile<"CallAndMessageChecker.cpp">; 91 92def NonNullParamChecker : Checker<"NonNullParamChecker">, 93 HelpText<"Check for null pointers passed as arguments to a function whose arguments are references or marked with the 'nonnull' attribute">, 94 DescFile<"NonNullParamChecker.cpp">; 95 96def VLASizeChecker : Checker<"VLASize">, 97 HelpText<"Check for declarations of VLA of undefined or zero size">, 98 DescFile<"VLASizeChecker.cpp">; 99 100def DivZeroChecker : Checker<"DivideZero">, 101 HelpText<"Check for division by zero">, 102 DescFile<"DivZeroChecker.cpp">; 103 104def UndefResultChecker : Checker<"UndefinedBinaryOperatorResult">, 105 HelpText<"Check for undefined results of binary operators">, 106 DescFile<"UndefResultChecker.cpp">; 107 108def StackAddrEscapeChecker : Checker<"StackAddressEscape">, 109 HelpText<"Check that addresses to stack memory do not escape the function">, 110 DescFile<"StackAddrEscapeChecker.cpp">; 111 112def DynamicTypePropagation : Checker<"DynamicTypePropagation">, 113 HelpText<"Generate dynamic type information">, 114 DescFile<"DynamicTypePropagation.cpp">; 115 116} // end "core" 117 118let ParentPackage = CoreAlpha in { 119 120def BoolAssignmentChecker : Checker<"BoolAssignment">, 121 HelpText<"Warn about assigning non-{0,1} values to Boolean variables">, 122 DescFile<"BoolAssignmentChecker.cpp">; 123 124def CastSizeChecker : Checker<"CastSize">, 125 HelpText<"Check when casting a malloc'ed type T, whether the size is a multiple of the size of T">, 126 DescFile<"CastSizeChecker.cpp">; 127 128def CastToStructChecker : Checker<"CastToStruct">, 129 HelpText<"Check for cast from non-struct pointer to struct pointer">, 130 DescFile<"CastToStructChecker.cpp">; 131 132def IdenticalExprChecker : Checker<"IdenticalExpr">, 133 HelpText<"Warn about unintended use of identical expressions in operators">, 134 DescFile<"IdenticalExprChecker.cpp">; 135 136def FixedAddressChecker : Checker<"FixedAddr">, 137 HelpText<"Check for assignment of a fixed address to a pointer">, 138 DescFile<"FixedAddressChecker.cpp">; 139 140def PointerArithChecker : Checker<"PointerArithm">, 141 HelpText<"Check for pointer arithmetic on locations other than array elements">, 142 DescFile<"PointerArithChecker">; 143 144def PointerSubChecker : Checker<"PointerSub">, 145 HelpText<"Check for pointer subtractions on two pointers pointing to different memory chunks">, 146 DescFile<"PointerSubChecker">; 147 148def SizeofPointerChecker : Checker<"SizeofPtr">, 149 HelpText<"Warn about unintended use of sizeof() on pointer expressions">, 150 DescFile<"CheckSizeofPointer.cpp">; 151 152def CallAndMessageUnInitRefArg : Checker<"CallAndMessageUnInitRefArg">, 153 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)">, 154 DescFile<"CallAndMessageChecker.cpp">; 155 156def TestAfterDivZeroChecker : Checker<"TestAfterDivZero">, 157 HelpText<"Check for division by variable that is later compared against 0. Either the comparison is useless or there is division by zero.">, 158 DescFile<"TestAfterDivZeroChecker.cpp">; 159 160def DynamicTypeChecker : Checker<"DynamicTypeChecker">, 161 HelpText<"Check for cases where the dynamic and the static type of an object are unrelated.">, 162 DescFile<"DynamicTypeChecker.cpp">; 163 164} // end "alpha.core" 165 166let ParentPackage = Nullability in { 167 168def NullPassedToNonnullChecker : Checker<"NullPassedToNonnull">, 169 HelpText<"Warns when a null pointer is passed to a pointer which has a _Nonnull type.">, 170 DescFile<"NullabilityChecker.cpp">; 171 172def NullReturnedFromNonnullChecker : Checker<"NullReturnedFromNonnull">, 173 HelpText<"Warns when a null pointer is returned from a function that has _Nonnull return type.">, 174 DescFile<"NullabilityChecker.cpp">; 175 176def NullableDereferencedChecker : Checker<"NullableDereferenced">, 177 HelpText<"Warns when a nullable pointer is dereferenced.">, 178 DescFile<"NullabilityChecker.cpp">; 179 180def NullablePassedToNonnullChecker : Checker<"NullablePassedToNonnull">, 181 HelpText<"Warns when a nullable pointer is passed to a pointer which has a _Nonnull type.">, 182 DescFile<"NullabilityChecker.cpp">; 183 184def NullableReturnedFromNonnullChecker : Checker<"NullablePassedToNonnull">, 185 HelpText<"Warns when a nullable pointer is returned from a function that has _Nonnull return type.">, 186 DescFile<"NullabilityChecker.cpp">; 187 188} // end "nullability" 189 190//===----------------------------------------------------------------------===// 191// Evaluate "builtin" functions. 192//===----------------------------------------------------------------------===// 193 194let ParentPackage = CoreBuiltin in { 195 196def NoReturnFunctionChecker : Checker<"NoReturnFunctions">, 197 HelpText<"Evaluate \"panic\" functions that are known to not return to the caller">, 198 DescFile<"NoReturnFunctionChecker.cpp">; 199 200def BuiltinFunctionChecker : Checker<"BuiltinFunctions">, 201 HelpText<"Evaluate compiler builtin functions (e.g., alloca())">, 202 DescFile<"BuiltinFunctionChecker.cpp">; 203 204} // end "core.builtin" 205 206//===----------------------------------------------------------------------===// 207// Uninitialized values checkers. 208//===----------------------------------------------------------------------===// 209 210let ParentPackage = CoreUninitialized in { 211 212def UndefinedArraySubscriptChecker : Checker<"ArraySubscript">, 213 HelpText<"Check for uninitialized values used as array subscripts">, 214 DescFile<"UndefinedArraySubscriptChecker.cpp">; 215 216def UndefinedAssignmentChecker : Checker<"Assign">, 217 HelpText<"Check for assigning uninitialized values">, 218 DescFile<"UndefinedAssignmentChecker.cpp">; 219 220def UndefBranchChecker : Checker<"Branch">, 221 HelpText<"Check for uninitialized values used as branch conditions">, 222 DescFile<"UndefBranchChecker.cpp">; 223 224def UndefCapturedBlockVarChecker : Checker<"CapturedBlockVariable">, 225 HelpText<"Check for blocks that capture uninitialized values">, 226 DescFile<"UndefCapturedBlockVarChecker.cpp">; 227 228def ReturnUndefChecker : Checker<"UndefReturn">, 229 HelpText<"Check for uninitialized values being returned to the caller">, 230 DescFile<"ReturnUndefChecker.cpp">; 231 232} // end "core.uninitialized" 233 234//===----------------------------------------------------------------------===// 235// C++ checkers. 236//===----------------------------------------------------------------------===// 237 238let ParentPackage = Cplusplus in { 239 240def NewDeleteChecker : Checker<"NewDelete">, 241 HelpText<"Check for double-free and use-after-free problems. Traces memory managed by new/delete.">, 242 DescFile<"MallocChecker.cpp">; 243 244def NewDeleteLeaksChecker : Checker<"NewDeleteLeaks">, 245 HelpText<"Check for memory leaks. Traces memory managed by new/delete.">, 246 DescFile<"MallocChecker.cpp">; 247 248} // end: "cplusplus" 249 250let ParentPackage = CplusplusAlpha in { 251 252def VirtualCallChecker : Checker<"VirtualCall">, 253 HelpText<"Check virtual function calls during construction or destruction">, 254 DescFile<"VirtualCallChecker.cpp">; 255 256} // end: "alpha.cplusplus" 257 258//===----------------------------------------------------------------------===// 259// Deadcode checkers. 260//===----------------------------------------------------------------------===// 261 262let ParentPackage = DeadCode in { 263 264def DeadStoresChecker : Checker<"DeadStores">, 265 HelpText<"Check for values stored to variables that are never read afterwards">, 266 DescFile<"DeadStoresChecker.cpp">; 267} // end DeadCode 268 269let ParentPackage = DeadCodeAlpha in { 270 271def UnreachableCodeChecker : Checker<"UnreachableCode">, 272 HelpText<"Check unreachable code">, 273 DescFile<"UnreachableCodeChecker.cpp">; 274 275} // end "alpha.deadcode" 276 277//===----------------------------------------------------------------------===// 278// Performance checkers. 279//===----------------------------------------------------------------------===// 280 281let ParentPackage = Performance in { 282 283def PaddingChecker : Checker<"Padding">, 284 HelpText<"Check for excessively padded structs.">, 285 DescFile<"PaddingChecker.cpp">; 286 287} // end: "padding" 288 289//===----------------------------------------------------------------------===// 290// Security checkers. 291//===----------------------------------------------------------------------===// 292 293let ParentPackage = InsecureAPI in { 294 def gets : Checker<"gets">, 295 HelpText<"Warn on uses of the 'gets' function">, 296 DescFile<"CheckSecuritySyntaxOnly.cpp">; 297 def getpw : Checker<"getpw">, 298 HelpText<"Warn on uses of the 'getpw' function">, 299 DescFile<"CheckSecuritySyntaxOnly.cpp">; 300 def mktemp : Checker<"mktemp">, 301 HelpText<"Warn on uses of the 'mktemp' function">, 302 DescFile<"CheckSecuritySyntaxOnly.cpp">; 303 def mkstemp : Checker<"mkstemp">, 304 HelpText<"Warn when 'mkstemp' is passed fewer than 6 X's in the format string">, 305 DescFile<"CheckSecuritySyntaxOnly.cpp">; 306 def rand : Checker<"rand">, 307 HelpText<"Warn on uses of the 'rand', 'random', and related functions">, 308 DescFile<"CheckSecuritySyntaxOnly.cpp">; 309 def strcpy : Checker<"strcpy">, 310 HelpText<"Warn on uses of the 'strcpy' and 'strcat' functions">, 311 DescFile<"CheckSecuritySyntaxOnly.cpp">; 312 def vfork : Checker<"vfork">, 313 HelpText<"Warn on uses of the 'vfork' function">, 314 DescFile<"CheckSecuritySyntaxOnly.cpp">; 315 def UncheckedReturn : Checker<"UncheckedReturn">, 316 HelpText<"Warn on uses of functions whose return values must be always checked">, 317 DescFile<"CheckSecuritySyntaxOnly.cpp">; 318} 319let ParentPackage = Security in { 320 def FloatLoopCounter : Checker<"FloatLoopCounter">, 321 HelpText<"Warn on using a floating point value as a loop counter (CERT: FLP30-C, FLP30-CPP)">, 322 DescFile<"CheckSecuritySyntaxOnly.cpp">; 323} 324 325let ParentPackage = SecurityAlpha in { 326 327def ArrayBoundChecker : Checker<"ArrayBound">, 328 HelpText<"Warn about buffer overflows (older checker)">, 329 DescFile<"ArrayBoundChecker.cpp">; 330 331def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">, 332 HelpText<"Warn about buffer overflows (newer checker)">, 333 DescFile<"ArrayBoundCheckerV2.cpp">; 334 335def ReturnPointerRangeChecker : Checker<"ReturnPtrRange">, 336 HelpText<"Check for an out-of-bound pointer being returned to callers">, 337 DescFile<"ReturnPointerRangeChecker.cpp">; 338 339def MallocOverflowSecurityChecker : Checker<"MallocOverflow">, 340 HelpText<"Check for overflows in the arguments to malloc()">, 341 DescFile<"MallocOverflowSecurityChecker.cpp">; 342 343} // end "alpha.security" 344 345//===----------------------------------------------------------------------===// 346// Taint checkers. 347//===----------------------------------------------------------------------===// 348 349let ParentPackage = Taint in { 350 351def GenericTaintChecker : Checker<"TaintPropagation">, 352 HelpText<"Generate taint information used by other checkers">, 353 DescFile<"GenericTaintChecker.cpp">; 354 355} // end "alpha.security.taint" 356 357//===----------------------------------------------------------------------===// 358// Unix API checkers. 359//===----------------------------------------------------------------------===// 360 361let ParentPackage = Unix in { 362 363def UnixAPIChecker : Checker<"API">, 364 HelpText<"Check calls to various UNIX/Posix functions">, 365 DescFile<"UnixAPIChecker.cpp">; 366 367def MallocChecker: Checker<"Malloc">, 368 HelpText<"Check for memory leaks, double free, and use-after-free problems. Traces memory managed by malloc()/free().">, 369 DescFile<"MallocChecker.cpp">; 370 371def MallocSizeofChecker : Checker<"MallocSizeof">, 372 HelpText<"Check for dubious malloc arguments involving sizeof">, 373 DescFile<"MallocSizeofChecker.cpp">; 374 375def MismatchedDeallocatorChecker : Checker<"MismatchedDeallocator">, 376 HelpText<"Check for mismatched deallocators.">, 377 DescFile<"MallocChecker.cpp">; 378 379def VforkChecker : Checker<"Vfork">, 380 HelpText<"Check for proper usage of vfork">, 381 DescFile<"VforkChecker.cpp">; 382 383} // end "unix" 384 385let ParentPackage = UnixAlpha in { 386 387def ChrootChecker : Checker<"Chroot">, 388 HelpText<"Check improper use of chroot">, 389 DescFile<"ChrootChecker.cpp">; 390 391def PthreadLockChecker : Checker<"PthreadLock">, 392 HelpText<"Simple lock -> unlock checker">, 393 DescFile<"PthreadLockChecker.cpp">; 394 395def StreamChecker : Checker<"Stream">, 396 HelpText<"Check stream handling functions">, 397 DescFile<"StreamChecker.cpp">; 398 399def SimpleStreamChecker : Checker<"SimpleStream">, 400 HelpText<"Check for misuses of stream APIs">, 401 DescFile<"SimpleStreamChecker.cpp">; 402 403} // end "alpha.unix" 404 405let ParentPackage = CString in { 406 407def CStringNullArg : Checker<"NullArg">, 408 HelpText<"Check for null pointers being passed as arguments to C string functions">, 409 DescFile<"CStringChecker.cpp">; 410 411def CStringSyntaxChecker : Checker<"BadSizeArg">, 412 HelpText<"Check the size argument passed into C string functions for common erroneous patterns">, 413 DescFile<"CStringSyntaxChecker.cpp">; 414} 415 416let ParentPackage = CStringAlpha in { 417 418def CStringOutOfBounds : Checker<"OutOfBounds">, 419 HelpText<"Check for out-of-bounds access in string functions">, 420 DescFile<"CStringChecker.cpp">; 421 422def CStringBufferOverlap : Checker<"BufferOverlap">, 423 HelpText<"Checks for overlap in two buffer arguments">, 424 DescFile<"CStringChecker.cpp">; 425 426def CStringNotNullTerm : Checker<"NotNullTerminated">, 427 HelpText<"Check for arguments which are not null-terminating strings">, 428 DescFile<"CStringChecker.cpp">; 429} 430 431//===----------------------------------------------------------------------===// 432// Mac OS X, Cocoa, and Core Foundation checkers. 433//===----------------------------------------------------------------------===// 434 435let ParentPackage = OSX in { 436 437def MacOSXAPIChecker : Checker<"API">, 438 InPackage<OSX>, 439 HelpText<"Check for proper uses of various Apple APIs">, 440 DescFile<"MacOSXAPIChecker.cpp">; 441 442def MacOSKeychainAPIChecker : Checker<"SecKeychainAPI">, 443 InPackage<OSX>, 444 HelpText<"Check for proper uses of Secure Keychain APIs">, 445 DescFile<"MacOSKeychainAPIChecker.cpp">; 446 447} // end "osx" 448 449let ParentPackage = Cocoa in { 450 451def ObjCAtSyncChecker : Checker<"AtSync">, 452 HelpText<"Check for nil pointers used as mutexes for @synchronized">, 453 DescFile<"ObjCAtSyncChecker.cpp">; 454 455def NilArgChecker : Checker<"NilArg">, 456 HelpText<"Check for prohibited nil arguments to ObjC method calls">, 457 DescFile<"BasicObjCFoundationChecks.cpp">; 458 459def ClassReleaseChecker : Checker<"ClassRelease">, 460 HelpText<"Check for sending 'retain', 'release', or 'autorelease' directly to a Class">, 461 DescFile<"BasicObjCFoundationChecks.cpp">; 462 463def VariadicMethodTypeChecker : Checker<"VariadicMethodTypes">, 464 HelpText<"Check for passing non-Objective-C types to variadic collection " 465 "initialization methods that expect only Objective-C types">, 466 DescFile<"BasicObjCFoundationChecks.cpp">; 467 468def NSAutoreleasePoolChecker : Checker<"NSAutoreleasePool">, 469 HelpText<"Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode">, 470 DescFile<"NSAutoreleasePoolChecker.cpp">; 471 472def ObjCMethSigsChecker : Checker<"IncompatibleMethodTypes">, 473 HelpText<"Warn about Objective-C method signatures with type incompatibilities">, 474 DescFile<"CheckObjCInstMethSignature.cpp">; 475 476def ObjCUnusedIvarsChecker : Checker<"UnusedIvars">, 477 HelpText<"Warn about private ivars that are never used">, 478 DescFile<"ObjCUnusedIVarsChecker.cpp">; 479 480def ObjCSelfInitChecker : Checker<"SelfInit">, 481 HelpText<"Check that 'self' is properly initialized inside an initializer method">, 482 DescFile<"ObjCSelfInitChecker.cpp">; 483 484def ObjCLoopChecker : Checker<"Loops">, 485 HelpText<"Improved modeling of loops using Cocoa collection types">, 486 DescFile<"BasicObjCFoundationChecks.cpp">; 487 488def ObjCNonNilReturnValueChecker : Checker<"NonNilReturnValue">, 489 HelpText<"Model the APIs that are guaranteed to return a non-nil value">, 490 DescFile<"BasicObjCFoundationChecks.cpp">; 491 492def ObjCSuperCallChecker : Checker<"MissingSuperCall">, 493 HelpText<"Warn about Objective-C methods that lack a necessary call to super">, 494 DescFile<"ObjCMissingSuperCallChecker.cpp">; 495 496def NSErrorChecker : Checker<"NSError">, 497 HelpText<"Check usage of NSError** parameters">, 498 DescFile<"NSErrorChecker.cpp">; 499 500def RetainCountChecker : Checker<"RetainCount">, 501 HelpText<"Check for leaks and improper reference count management">, 502 DescFile<"RetainCountChecker.cpp">; 503 504def ObjCGenericsChecker : Checker<"ObjCGenerics">, 505 HelpText<"Check for type errors when using Objective-C generics">, 506 DescFile<"DynamicTypePropagation.cpp">; 507 508} // end "osx.cocoa" 509 510let ParentPackage = CocoaAlpha in { 511 512def ObjCDeallocChecker : Checker<"Dealloc">, 513 HelpText<"Warn about Objective-C classes that lack a correct implementation of -dealloc">, 514 DescFile<"CheckObjCDealloc.cpp">; 515 516def InstanceVariableInvalidation : Checker<"InstanceVariableInvalidation">, 517 HelpText<"Check that the invalidatable instance variables are invalidated in the methods annotated with objc_instance_variable_invalidator">, 518 DescFile<"IvarInvalidationChecker.cpp">; 519 520def MissingInvalidationMethod : Checker<"MissingInvalidationMethod">, 521 HelpText<"Check that the invalidation methods are present in classes that contain invalidatable instance variables">, 522 DescFile<"IvarInvalidationChecker.cpp">; 523 524def DirectIvarAssignment : Checker<"DirectIvarAssignment">, 525 HelpText<"Check for direct assignments to instance variables">, 526 DescFile<"DirectIvarAssignment.cpp">; 527 528def DirectIvarAssignmentForAnnotatedFunctions : Checker<"DirectIvarAssignmentForAnnotatedFunctions">, 529 HelpText<"Check for direct assignments to instance variables in the methods annotated with objc_no_direct_instance_variable_assignment">, 530 DescFile<"DirectIvarAssignment.cpp">; 531 532} // end "alpha.osx.cocoa" 533 534let ParentPackage = CoreFoundation in { 535 536def CFNumberCreateChecker : Checker<"CFNumber">, 537 HelpText<"Check for proper uses of CFNumberCreate">, 538 DescFile<"BasicObjCFoundationChecks.cpp">; 539 540def CFRetainReleaseChecker : Checker<"CFRetainRelease">, 541 HelpText<"Check for null arguments to CFRetain/CFRelease/CFMakeCollectable">, 542 DescFile<"BasicObjCFoundationChecks.cpp">; 543 544def CFErrorChecker : Checker<"CFError">, 545 HelpText<"Check usage of CFErrorRef* parameters">, 546 DescFile<"NSErrorChecker.cpp">; 547} 548 549let ParentPackage = Containers in { 550def ObjCContainersASTChecker : Checker<"PointerSizedValues">, 551 HelpText<"Warns if 'CFArray', 'CFDictionary', 'CFSet' are created with non-pointer-size values">, 552 DescFile<"ObjCContainersASTChecker.cpp">; 553 554def ObjCContainersChecker : Checker<"OutOfBounds">, 555 HelpText<"Checks for index out-of-bounds when using 'CFArray' API">, 556 DescFile<"ObjCContainersChecker.cpp">; 557 558} 559 560let ParentPackage = LocalizabilityOptIn in { 561def NonLocalizedStringChecker : Checker<"NonLocalizedStringChecker">, 562 HelpText<"Warns about uses of non-localized NSStrings passed to UI methods expecting localized NSStrings">, 563 DescFile<"LocalizationChecker.cpp">; 564 565def EmptyLocalizationContextChecker : Checker<"EmptyLocalizationContextChecker">, 566 HelpText<"Check that NSLocalizedString macros include a comment for context">, 567 DescFile<"LocalizationChecker.cpp">; 568} 569 570let ParentPackage = LocalizabilityAlpha in { 571def PluralMisuseChecker : Checker<"PluralMisuseChecker">, 572 HelpText<"Warns against using one vs. many plural pattern in code when generating localized strings.">, 573 DescFile<"LocalizationChecker.cpp">; 574} 575 576//===----------------------------------------------------------------------===// 577// Checkers for LLVM development. 578//===----------------------------------------------------------------------===// 579 580def LLVMConventionsChecker : Checker<"Conventions">, 581 InPackage<LLVM>, 582 HelpText<"Check code for LLVM codebase conventions">, 583 DescFile<"LLVMConventionsChecker.cpp">; 584 585//===----------------------------------------------------------------------===// 586// Debugging checkers (for analyzer development). 587//===----------------------------------------------------------------------===// 588 589let ParentPackage = Debug in { 590 591def DominatorsTreeDumper : Checker<"DumpDominators">, 592 HelpText<"Print the dominance tree for a given CFG">, 593 DescFile<"DebugCheckers.cpp">; 594 595def LiveVariablesDumper : Checker<"DumpLiveVars">, 596 HelpText<"Print results of live variable analysis">, 597 DescFile<"DebugCheckers.cpp">; 598 599def CFGViewer : Checker<"ViewCFG">, 600 HelpText<"View Control-Flow Graphs using GraphViz">, 601 DescFile<"DebugCheckers.cpp">; 602 603def CFGDumper : Checker<"DumpCFG">, 604 HelpText<"Display Control-Flow Graphs">, 605 DescFile<"DebugCheckers.cpp">; 606 607def CallGraphViewer : Checker<"ViewCallGraph">, 608 HelpText<"View Call Graph using GraphViz">, 609 DescFile<"DebugCheckers.cpp">; 610 611def CallGraphDumper : Checker<"DumpCallGraph">, 612 HelpText<"Display Call Graph">, 613 DescFile<"DebugCheckers.cpp">; 614 615def ConfigDumper : Checker<"ConfigDumper">, 616 HelpText<"Dump config table">, 617 DescFile<"DebugCheckers.cpp">; 618 619def TraversalDumper : Checker<"DumpTraversal">, 620 HelpText<"Print branch conditions as they are traversed by the engine">, 621 DescFile<"TraversalChecker.cpp">; 622 623def CallDumper : Checker<"DumpCalls">, 624 HelpText<"Print calls as they are traversed by the engine">, 625 DescFile<"TraversalChecker.cpp">; 626 627def AnalyzerStatsChecker : Checker<"Stats">, 628 HelpText<"Emit warnings with analyzer statistics">, 629 DescFile<"AnalyzerStatsChecker.cpp">; 630 631def TaintTesterChecker : Checker<"TaintTest">, 632 HelpText<"Mark tainted symbols as such.">, 633 DescFile<"TaintTesterChecker.cpp">; 634 635def ExprInspectionChecker : Checker<"ExprInspection">, 636 HelpText<"Check the analyzer's understanding of expressions">, 637 DescFile<"ExprInspectionChecker.cpp">; 638 639def ExplodedGraphViewer : Checker<"ViewExplodedGraph">, 640 HelpText<"View Exploded Graphs using GraphViz">, 641 DescFile<"DebugCheckers.cpp">; 642 643def BugHashDumper : Checker<"DumpBugHash">, 644 HelpText<"Dump the bug hash for all statements.">, 645 DescFile<"DebugCheckers.cpp">; 646 647} // end "debug" 648