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 10 include "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). 21 def Alpha : Package<"alpha">; 22 23 def Core : Package<"core">; 24 def CoreBuiltin : Package<"builtin">, InPackage<Core>; 25 def CoreUninitialized : Package<"uninitialized">, InPackage<Core>; 26 def 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. 39 def OptIn : Package<"optin">; 40 41 def Nullability : Package<"nullability">; 42 43 def Cplusplus : Package<"cplusplus">; 44 def CplusplusAlpha : Package<"cplusplus">, InPackage<Alpha>, Hidden; 45 46 def DeadCode : Package<"deadcode">; 47 def DeadCodeAlpha : Package<"deadcode">, InPackage<Alpha>, Hidden; 48 49 def Performance : Package<"performance">, InPackage<OptIn>; 50 51 def Security : Package <"security">; 52 def InsecureAPI : Package<"insecureAPI">, InPackage<Security>; 53 def SecurityAlpha : Package<"security">, InPackage<Alpha>, Hidden; 54 def Taint : Package<"taint">, InPackage<SecurityAlpha>, Hidden; 55 56 def Unix : Package<"unix">; 57 def UnixAlpha : Package<"unix">, InPackage<Alpha>, Hidden; 58 def CString : Package<"cstring">, InPackage<Unix>, Hidden; 59 def CStringAlpha : Package<"cstring">, InPackage<UnixAlpha>, Hidden; 60 61 def OSX : Package<"osx">; 62 def OSXAlpha : Package<"osx">, InPackage<Alpha>, Hidden; 63 def OSXOptIn : Package<"osx">, InPackage<OptIn>; 64 65 def Cocoa : Package<"cocoa">, InPackage<OSX>; 66 def CocoaAlpha : Package<"cocoa">, InPackage<OSXAlpha>, Hidden; 67 def CocoaOptIn : Package<"cocoa">, InPackage<OSXOptIn>; 68 69 def CoreFoundation : Package<"coreFoundation">, InPackage<OSX>; 70 def Containers : Package<"containers">, InPackage<CoreFoundation>; 71 72 def LocalizabilityAlpha : Package<"localizability">, InPackage<CocoaAlpha>; 73 def LocalizabilityOptIn : Package<"localizability">, InPackage<CocoaOptIn>; 74 75 def LLVM : Package<"llvm">; 76 def Debug : Package<"debug">; 77 78 //===----------------------------------------------------------------------===// 79 // Core Checkers. 80 //===----------------------------------------------------------------------===// 81 82 let ParentPackage = Core in { 83 84 def DereferenceChecker : Checker<"NullDereference">, 85 HelpText<"Check for dereferences of null pointers">, 86 DescFile<"DereferenceChecker.cpp">; 87 88 def 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 92 def 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 96 def VLASizeChecker : Checker<"VLASize">, 97 HelpText<"Check for declarations of VLA of undefined or zero size">, 98 DescFile<"VLASizeChecker.cpp">; 99 100 def DivZeroChecker : Checker<"DivideZero">, 101 HelpText<"Check for division by zero">, 102 DescFile<"DivZeroChecker.cpp">; 103 104 def UndefResultChecker : Checker<"UndefinedBinaryOperatorResult">, 105 HelpText<"Check for undefined results of binary operators">, 106 DescFile<"UndefResultChecker.cpp">; 107 108 def StackAddrEscapeChecker : Checker<"StackAddressEscape">, 109 HelpText<"Check that addresses to stack memory do not escape the function">, 110 DescFile<"StackAddrEscapeChecker.cpp">; 111 112 def DynamicTypePropagation : Checker<"DynamicTypePropagation">, 113 HelpText<"Generate dynamic type information">, 114 DescFile<"DynamicTypePropagation.cpp">; 115 116 } // end "core" 117 118 let ParentPackage = CoreAlpha in { 119 120 def BoolAssignmentChecker : Checker<"BoolAssignment">, 121 HelpText<"Warn about assigning non-{0,1} values to Boolean variables">, 122 DescFile<"BoolAssignmentChecker.cpp">; 123 124 def 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 128 def CastToStructChecker : Checker<"CastToStruct">, 129 HelpText<"Check for cast from non-struct pointer to struct pointer">, 130 DescFile<"CastToStructChecker.cpp">; 131 132 def IdenticalExprChecker : Checker<"IdenticalExpr">, 133 HelpText<"Warn about unintended use of identical expressions in operators">, 134 DescFile<"IdenticalExprChecker.cpp">; 135 136 def FixedAddressChecker : Checker<"FixedAddr">, 137 HelpText<"Check for assignment of a fixed address to a pointer">, 138 DescFile<"FixedAddressChecker.cpp">; 139 140 def PointerArithChecker : Checker<"PointerArithm">, 141 HelpText<"Check for pointer arithmetic on locations other than array elements">, 142 DescFile<"PointerArithChecker">; 143 144 def PointerSubChecker : Checker<"PointerSub">, 145 HelpText<"Check for pointer subtractions on two pointers pointing to different memory chunks">, 146 DescFile<"PointerSubChecker">; 147 148 def SizeofPointerChecker : Checker<"SizeofPtr">, 149 HelpText<"Warn about unintended use of sizeof() on pointer expressions">, 150 DescFile<"CheckSizeofPointer.cpp">; 151 152 def 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 156 def 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 160 def 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 166 let ParentPackage = Nullability in { 167 168 def 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 172 def 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 176 def NullableDereferencedChecker : Checker<"NullableDereferenced">, 177 HelpText<"Warns when a nullable pointer is dereferenced.">, 178 DescFile<"NullabilityChecker.cpp">; 179 180 def 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 184 def 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 194 let ParentPackage = CoreBuiltin in { 195 196 def NoReturnFunctionChecker : Checker<"NoReturnFunctions">, 197 HelpText<"Evaluate \"panic\" functions that are known to not return to the caller">, 198 DescFile<"NoReturnFunctionChecker.cpp">; 199 200 def 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 210 let ParentPackage = CoreUninitialized in { 211 212 def UndefinedArraySubscriptChecker : Checker<"ArraySubscript">, 213 HelpText<"Check for uninitialized values used as array subscripts">, 214 DescFile<"UndefinedArraySubscriptChecker.cpp">; 215 216 def UndefinedAssignmentChecker : Checker<"Assign">, 217 HelpText<"Check for assigning uninitialized values">, 218 DescFile<"UndefinedAssignmentChecker.cpp">; 219 220 def UndefBranchChecker : Checker<"Branch">, 221 HelpText<"Check for uninitialized values used as branch conditions">, 222 DescFile<"UndefBranchChecker.cpp">; 223 224 def UndefCapturedBlockVarChecker : Checker<"CapturedBlockVariable">, 225 HelpText<"Check for blocks that capture uninitialized values">, 226 DescFile<"UndefCapturedBlockVarChecker.cpp">; 227 228 def 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 238 let ParentPackage = Cplusplus in { 239 240 def 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 244 def NewDeleteLeaksChecker : Checker<"NewDeleteLeaks">, 245 HelpText<"Check for memory leaks. Traces memory managed by new/delete.">, 246 DescFile<"MallocChecker.cpp">; 247 248 } // end: "cplusplus" 249 250 let ParentPackage = CplusplusAlpha in { 251 252 def 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 262 let ParentPackage = DeadCode in { 263 264 def DeadStoresChecker : Checker<"DeadStores">, 265 HelpText<"Check for values stored to variables that are never read afterwards">, 266 DescFile<"DeadStoresChecker.cpp">; 267 } // end DeadCode 268 269 let ParentPackage = DeadCodeAlpha in { 270 271 def UnreachableCodeChecker : Checker<"UnreachableCode">, 272 HelpText<"Check unreachable code">, 273 DescFile<"UnreachableCodeChecker.cpp">; 274 275 } // end "alpha.deadcode" 276 277 //===----------------------------------------------------------------------===// 278 // Performance checkers. 279 //===----------------------------------------------------------------------===// 280 281 let ParentPackage = Performance in { 282 283 def 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 293 let 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 } 319 let 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 325 let ParentPackage = SecurityAlpha in { 326 327 def ArrayBoundChecker : Checker<"ArrayBound">, 328 HelpText<"Warn about buffer overflows (older checker)">, 329 DescFile<"ArrayBoundChecker.cpp">; 330 331 def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">, 332 HelpText<"Warn about buffer overflows (newer checker)">, 333 DescFile<"ArrayBoundCheckerV2.cpp">; 334 335 def ReturnPointerRangeChecker : Checker<"ReturnPtrRange">, 336 HelpText<"Check for an out-of-bound pointer being returned to callers">, 337 DescFile<"ReturnPointerRangeChecker.cpp">; 338 339 def 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 349 let ParentPackage = Taint in { 350 351 def 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 361 let ParentPackage = Unix in { 362 363 def UnixAPIChecker : Checker<"API">, 364 HelpText<"Check calls to various UNIX/Posix functions">, 365 DescFile<"UnixAPIChecker.cpp">; 366 367 def 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 371 def MallocSizeofChecker : Checker<"MallocSizeof">, 372 HelpText<"Check for dubious malloc arguments involving sizeof">, 373 DescFile<"MallocSizeofChecker.cpp">; 374 375 def MismatchedDeallocatorChecker : Checker<"MismatchedDeallocator">, 376 HelpText<"Check for mismatched deallocators.">, 377 DescFile<"MallocChecker.cpp">; 378 379 def VforkChecker : Checker<"Vfork">, 380 HelpText<"Check for proper usage of vfork">, 381 DescFile<"VforkChecker.cpp">; 382 383 } // end "unix" 384 385 let ParentPackage = UnixAlpha in { 386 387 def ChrootChecker : Checker<"Chroot">, 388 HelpText<"Check improper use of chroot">, 389 DescFile<"ChrootChecker.cpp">; 390 391 def PthreadLockChecker : Checker<"PthreadLock">, 392 HelpText<"Simple lock -> unlock checker">, 393 DescFile<"PthreadLockChecker.cpp">; 394 395 def StreamChecker : Checker<"Stream">, 396 HelpText<"Check stream handling functions">, 397 DescFile<"StreamChecker.cpp">; 398 399 def SimpleStreamChecker : Checker<"SimpleStream">, 400 HelpText<"Check for misuses of stream APIs">, 401 DescFile<"SimpleStreamChecker.cpp">; 402 403 } // end "alpha.unix" 404 405 let ParentPackage = CString in { 406 407 def CStringNullArg : Checker<"NullArg">, 408 HelpText<"Check for null pointers being passed as arguments to C string functions">, 409 DescFile<"CStringChecker.cpp">; 410 411 def CStringSyntaxChecker : Checker<"BadSizeArg">, 412 HelpText<"Check the size argument passed into C string functions for common erroneous patterns">, 413 DescFile<"CStringSyntaxChecker.cpp">; 414 } 415 416 let ParentPackage = CStringAlpha in { 417 418 def CStringOutOfBounds : Checker<"OutOfBounds">, 419 HelpText<"Check for out-of-bounds access in string functions">, 420 DescFile<"CStringChecker.cpp">; 421 422 def CStringBufferOverlap : Checker<"BufferOverlap">, 423 HelpText<"Checks for overlap in two buffer arguments">, 424 DescFile<"CStringChecker.cpp">; 425 426 def 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 435 let ParentPackage = OSX in { 436 437 def MacOSXAPIChecker : Checker<"API">, 438 InPackage<OSX>, 439 HelpText<"Check for proper uses of various Apple APIs">, 440 DescFile<"MacOSXAPIChecker.cpp">; 441 442 def 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 449 let ParentPackage = Cocoa in { 450 451 def ObjCAtSyncChecker : Checker<"AtSync">, 452 HelpText<"Check for nil pointers used as mutexes for @synchronized">, 453 DescFile<"ObjCAtSyncChecker.cpp">; 454 455 def NilArgChecker : Checker<"NilArg">, 456 HelpText<"Check for prohibited nil arguments to ObjC method calls">, 457 DescFile<"BasicObjCFoundationChecks.cpp">; 458 459 def ClassReleaseChecker : Checker<"ClassRelease">, 460 HelpText<"Check for sending 'retain', 'release', or 'autorelease' directly to a Class">, 461 DescFile<"BasicObjCFoundationChecks.cpp">; 462 463 def 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 468 def NSAutoreleasePoolChecker : Checker<"NSAutoreleasePool">, 469 HelpText<"Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode">, 470 DescFile<"NSAutoreleasePoolChecker.cpp">; 471 472 def ObjCMethSigsChecker : Checker<"IncompatibleMethodTypes">, 473 HelpText<"Warn about Objective-C method signatures with type incompatibilities">, 474 DescFile<"CheckObjCInstMethSignature.cpp">; 475 476 def ObjCUnusedIvarsChecker : Checker<"UnusedIvars">, 477 HelpText<"Warn about private ivars that are never used">, 478 DescFile<"ObjCUnusedIVarsChecker.cpp">; 479 480 def ObjCSelfInitChecker : Checker<"SelfInit">, 481 HelpText<"Check that 'self' is properly initialized inside an initializer method">, 482 DescFile<"ObjCSelfInitChecker.cpp">; 483 484 def ObjCLoopChecker : Checker<"Loops">, 485 HelpText<"Improved modeling of loops using Cocoa collection types">, 486 DescFile<"BasicObjCFoundationChecks.cpp">; 487 488 def ObjCNonNilReturnValueChecker : Checker<"NonNilReturnValue">, 489 HelpText<"Model the APIs that are guaranteed to return a non-nil value">, 490 DescFile<"BasicObjCFoundationChecks.cpp">; 491 492 def ObjCSuperCallChecker : Checker<"MissingSuperCall">, 493 HelpText<"Warn about Objective-C methods that lack a necessary call to super">, 494 DescFile<"ObjCMissingSuperCallChecker.cpp">; 495 496 def NSErrorChecker : Checker<"NSError">, 497 HelpText<"Check usage of NSError** parameters">, 498 DescFile<"NSErrorChecker.cpp">; 499 500 def RetainCountChecker : Checker<"RetainCount">, 501 HelpText<"Check for leaks and improper reference count management">, 502 DescFile<"RetainCountChecker.cpp">; 503 504 def ObjCGenericsChecker : Checker<"ObjCGenerics">, 505 HelpText<"Check for type errors when using Objective-C generics">, 506 DescFile<"DynamicTypePropagation.cpp">; 507 508 } // end "osx.cocoa" 509 510 let ParentPackage = CocoaAlpha in { 511 512 def ObjCDeallocChecker : Checker<"Dealloc">, 513 HelpText<"Warn about Objective-C classes that lack a correct implementation of -dealloc">, 514 DescFile<"CheckObjCDealloc.cpp">; 515 516 def 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 520 def MissingInvalidationMethod : Checker<"MissingInvalidationMethod">, 521 HelpText<"Check that the invalidation methods are present in classes that contain invalidatable instance variables">, 522 DescFile<"IvarInvalidationChecker.cpp">; 523 524 def DirectIvarAssignment : Checker<"DirectIvarAssignment">, 525 HelpText<"Check for direct assignments to instance variables">, 526 DescFile<"DirectIvarAssignment.cpp">; 527 528 def 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 534 let ParentPackage = CoreFoundation in { 535 536 def CFNumberCreateChecker : Checker<"CFNumber">, 537 HelpText<"Check for proper uses of CFNumberCreate">, 538 DescFile<"BasicObjCFoundationChecks.cpp">; 539 540 def CFRetainReleaseChecker : Checker<"CFRetainRelease">, 541 HelpText<"Check for null arguments to CFRetain/CFRelease/CFMakeCollectable">, 542 DescFile<"BasicObjCFoundationChecks.cpp">; 543 544 def CFErrorChecker : Checker<"CFError">, 545 HelpText<"Check usage of CFErrorRef* parameters">, 546 DescFile<"NSErrorChecker.cpp">; 547 } 548 549 let ParentPackage = Containers in { 550 def ObjCContainersASTChecker : Checker<"PointerSizedValues">, 551 HelpText<"Warns if 'CFArray', 'CFDictionary', 'CFSet' are created with non-pointer-size values">, 552 DescFile<"ObjCContainersASTChecker.cpp">; 553 554 def ObjCContainersChecker : Checker<"OutOfBounds">, 555 HelpText<"Checks for index out-of-bounds when using 'CFArray' API">, 556 DescFile<"ObjCContainersChecker.cpp">; 557 558 } 559 560 let ParentPackage = LocalizabilityOptIn in { 561 def NonLocalizedStringChecker : Checker<"NonLocalizedStringChecker">, 562 HelpText<"Warns about uses of non-localized NSStrings passed to UI methods expecting localized NSStrings">, 563 DescFile<"LocalizationChecker.cpp">; 564 565 def EmptyLocalizationContextChecker : Checker<"EmptyLocalizationContextChecker">, 566 HelpText<"Check that NSLocalizedString macros include a comment for context">, 567 DescFile<"LocalizationChecker.cpp">; 568 } 569 570 let ParentPackage = LocalizabilityAlpha in { 571 def 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 580 def 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 589 let ParentPackage = Debug in { 590 591 def DominatorsTreeDumper : Checker<"DumpDominators">, 592 HelpText<"Print the dominance tree for a given CFG">, 593 DescFile<"DebugCheckers.cpp">; 594 595 def LiveVariablesDumper : Checker<"DumpLiveVars">, 596 HelpText<"Print results of live variable analysis">, 597 DescFile<"DebugCheckers.cpp">; 598 599 def CFGViewer : Checker<"ViewCFG">, 600 HelpText<"View Control-Flow Graphs using GraphViz">, 601 DescFile<"DebugCheckers.cpp">; 602 603 def CFGDumper : Checker<"DumpCFG">, 604 HelpText<"Display Control-Flow Graphs">, 605 DescFile<"DebugCheckers.cpp">; 606 607 def CallGraphViewer : Checker<"ViewCallGraph">, 608 HelpText<"View Call Graph using GraphViz">, 609 DescFile<"DebugCheckers.cpp">; 610 611 def CallGraphDumper : Checker<"DumpCallGraph">, 612 HelpText<"Display Call Graph">, 613 DescFile<"DebugCheckers.cpp">; 614 615 def ConfigDumper : Checker<"ConfigDumper">, 616 HelpText<"Dump config table">, 617 DescFile<"DebugCheckers.cpp">; 618 619 def TraversalDumper : Checker<"DumpTraversal">, 620 HelpText<"Print branch conditions as they are traversed by the engine">, 621 DescFile<"TraversalChecker.cpp">; 622 623 def CallDumper : Checker<"DumpCalls">, 624 HelpText<"Print calls as they are traversed by the engine">, 625 DescFile<"TraversalChecker.cpp">; 626 627 def AnalyzerStatsChecker : Checker<"Stats">, 628 HelpText<"Emit warnings with analyzer statistics">, 629 DescFile<"AnalyzerStatsChecker.cpp">; 630 631 def TaintTesterChecker : Checker<"TaintTest">, 632 HelpText<"Mark tainted symbols as such.">, 633 DescFile<"TaintTesterChecker.cpp">; 634 635 def ExprInspectionChecker : Checker<"ExprInspection">, 636 HelpText<"Check the analyzer's understanding of expressions">, 637 DescFile<"ExprInspectionChecker.cpp">; 638 639 def ExplodedGraphViewer : Checker<"ViewExplodedGraph">, 640 HelpText<"View Exploded Graphs using GraphViz">, 641 DescFile<"DebugCheckers.cpp">; 642 643 def BugHashDumper : Checker<"DumpBugHash">, 644 HelpText<"Dump the bug hash for all statements.">, 645 DescFile<"DebugCheckers.cpp">; 646 647 } // end "debug" 648