]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
MFC r355940:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / clang / include / clang / StaticAnalyzer / Checkers / Checkers.td
1 //===--- Checkers.td - Static Analyzer Checkers -===-----------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 include "CheckerBase.td"
10
11 //===----------------------------------------------------------------------===//
12 // Packages.
13 //===----------------------------------------------------------------------===//
14
15 // The Alpha package is for checkers that have too many false positives to be
16 // turned on by default. The hierarchy under Alpha should be organized in the
17 // hierarchy checkers would have had if they were truly at the top level.
18 // (For example, a Cocoa-specific checker that is alpha should be in
19 // alpha.osx.cocoa).
20 def Alpha : Package<"alpha">;
21
22 def Core : Package<"core">;
23 def CoreBuiltin : Package<"builtin">, ParentPackage<Core>, Hidden;
24 def CoreUninitialized  : Package<"uninitialized">, ParentPackage<Core>;
25 def CoreAlpha : Package<"core">, ParentPackage<Alpha>;
26
27 // The OptIn package is for checkers that are not alpha and that would normally
28 // be on by default but where the driver does not have enough information to
29 // determine when they are applicable. For example, localizability checkers fit
30 // this criterion because the driver cannot determine whether a project is
31 // localized or not -- this is best determined at the IDE or build-system level.
32 //
33 // The checker hierarchy under OptIn should mirror that in Alpha: checkers
34 // should be organized as if they were at the top level.
35 //
36 // Note: OptIn is *not* intended for checkers that are too noisy to be on by
37 // default. Such checkers belong in the alpha package.
38 def OptIn : Package<"optin">;
39
40 // In the Portability package reside checkers for finding code that relies on
41 // implementation-defined behavior. Such checks are wanted for cross-platform
42 // development, but unwanted for developers who target only a single platform.
43 def PortabilityOptIn : Package<"portability">, ParentPackage<OptIn>;
44
45 def Nullability : Package<"nullability">,
46   PackageOptions<[
47     CmdLineOption<Boolean,
48                   "NoDiagnoseCallsToSystemHeaders",
49                   "Suppresses warnings for violating nullability annotations "
50                   "of system header functions. This is useful if you are "
51                   "concerned with your custom nullability annotations more "
52                   "than with following nullability specifications of system "
53                   "header functions.",
54                   "false",
55                   Released>
56   ]>;
57
58 def Cplusplus : Package<"cplusplus">;
59 def CplusplusAlpha : Package<"cplusplus">, ParentPackage<Alpha>;
60 def CplusplusOptIn : Package<"cplusplus">, ParentPackage<OptIn>;
61
62 def Valist : Package<"valist">;
63
64 def DeadCode : Package<"deadcode">;
65 def DeadCodeAlpha : Package<"deadcode">, ParentPackage<Alpha>;
66
67 def Performance : Package<"performance">, ParentPackage<OptIn>;
68
69 def Security : Package <"security">;
70 def InsecureAPI : Package<"insecureAPI">, ParentPackage<Security>;
71 def SecurityAlpha : Package<"security">, ParentPackage<Alpha>;
72 def Taint : Package<"taint">, ParentPackage<SecurityAlpha>;
73
74 def Unix : Package<"unix">;
75 def UnixAlpha : Package<"unix">, ParentPackage<Alpha>;
76 def CString : Package<"cstring">, ParentPackage<Unix>;
77 def CStringAlpha : Package<"cstring">, ParentPackage<UnixAlpha>;
78
79 def OSX : Package<"osx">;
80 def OSXAlpha : Package<"osx">, ParentPackage<Alpha>;
81 def OSXOptIn : Package<"osx">, ParentPackage<OptIn>;
82
83 def Cocoa : Package<"cocoa">, ParentPackage<OSX>;
84 def CocoaAlpha : Package<"cocoa">, ParentPackage<OSXAlpha>;
85 def CocoaOptIn : Package<"cocoa">, ParentPackage<OSXOptIn>;
86
87 def CoreFoundation : Package<"coreFoundation">, ParentPackage<OSX>;
88 def Containers : Package<"containers">, ParentPackage<CoreFoundation>;
89
90 def LocalizabilityAlpha : Package<"localizability">, ParentPackage<CocoaAlpha>;
91 def LocalizabilityOptIn : Package<"localizability">, ParentPackage<CocoaOptIn>;
92
93 def MPI : Package<"mpi">, ParentPackage<OptIn>;
94
95 def LLVM : Package<"llvm">;
96 def LLVMAlpha : Package<"llvm">, ParentPackage<Alpha>;
97
98 // The APIModeling package is for checkers that model APIs and don't perform
99 // any diagnostics. These checkers are always turned on; this package is
100 // intended for API modeling that is not controlled by the target triple.
101 def APIModeling : Package<"apiModeling">, Hidden;
102 def GoogleAPIModeling : Package<"google">, ParentPackage<APIModeling>, Hidden;
103 def LLVMAPIModeling : Package<"llvm">, ParentPackage<APIModeling>, Hidden;
104
105 def Debug : Package<"debug">, Hidden;
106
107 def CloneDetectionAlpha : Package<"clone">, ParentPackage<Alpha>;
108
109 def NonDeterminismAlpha : Package<"nondeterminism">, ParentPackage<Alpha>;
110
111 //===----------------------------------------------------------------------===//
112 // Core Checkers.
113 //===----------------------------------------------------------------------===//
114
115 let ParentPackage = Core in {
116
117 def DereferenceChecker : Checker<"NullDereference">,
118   HelpText<"Check for dereferences of null pointers">,
119   Documentation<HasDocumentation>;
120
121 def CallAndMessageChecker : Checker<"CallAndMessage">,
122   HelpText<"Check for logical errors for function calls and Objective-C "
123            "message expressions (e.g., uninitialized arguments, null function "
124            "pointers)">,
125   Documentation<HasDocumentation>;
126
127 def NonNullParamChecker : Checker<"NonNullParamChecker">,
128   HelpText<"Check for null pointers passed as arguments to a function whose "
129            "arguments are references or marked with the 'nonnull' attribute">,
130   Documentation<HasDocumentation>;
131
132 def VLASizeChecker : Checker<"VLASize">,
133   HelpText<"Check for declarations of VLA of undefined or zero size">,
134   Documentation<HasDocumentation>;
135
136 def DivZeroChecker : Checker<"DivideZero">,
137   HelpText<"Check for division by zero">,
138   Documentation<HasDocumentation>;
139
140 def UndefResultChecker : Checker<"UndefinedBinaryOperatorResult">,
141   HelpText<"Check for undefined results of binary operators">,
142   Documentation<HasDocumentation>;
143
144 def StackAddrEscapeBase : Checker<"StackAddrEscapeBase">,
145   HelpText<"Generate information about stack address escapes.">,
146   Documentation<NotDocumented>,
147   Hidden;
148
149 def StackAddrEscapeChecker : Checker<"StackAddressEscape">,
150   HelpText<"Check that addresses to stack memory do not escape the function">,
151   Dependencies<[StackAddrEscapeBase]>,
152   Documentation<HasDocumentation>;
153
154 def DynamicTypePropagation : Checker<"DynamicTypePropagation">,
155   HelpText<"Generate dynamic type information">,
156   Documentation<NotDocumented>;
157
158 def NonnullGlobalConstantsChecker: Checker<"NonnilStringConstants">,
159   HelpText<"Assume that const string-like globals are non-null">,
160   Documentation<NotDocumented>,
161   Hidden;
162
163 } // end "core"
164
165 let ParentPackage = CoreAlpha in {
166
167 def BoolAssignmentChecker : Checker<"BoolAssignment">,
168   HelpText<"Warn about assigning non-{0,1} values to Boolean variables">,
169   Documentation<HasAlphaDocumentation>;
170
171 def CastSizeChecker : Checker<"CastSize">,
172   HelpText<"Check when casting a malloc'ed type T, whether the size is a "
173            "multiple of the size of T">,
174   Documentation<HasAlphaDocumentation>;
175
176 def CastToStructChecker : Checker<"CastToStruct">,
177   HelpText<"Check for cast from non-struct pointer to struct pointer">,
178   Documentation<HasAlphaDocumentation>;
179
180 def ConversionChecker : Checker<"Conversion">,
181   HelpText<"Loss of sign/precision in implicit conversions">,
182   Documentation<HasAlphaDocumentation>;
183
184 def IdenticalExprChecker : Checker<"IdenticalExpr">,
185   HelpText<"Warn about unintended use of identical expressions in operators">,
186   Documentation<HasAlphaDocumentation>;
187
188 def FixedAddressChecker : Checker<"FixedAddr">,
189   HelpText<"Check for assignment of a fixed address to a pointer">,
190   Documentation<HasAlphaDocumentation>;
191
192 def PointerArithChecker : Checker<"PointerArithm">,
193   HelpText<"Check for pointer arithmetic on locations other than array "
194            "elements">,
195   Documentation<HasAlphaDocumentation>;
196
197 def PointerSubChecker : Checker<"PointerSub">,
198   HelpText<"Check for pointer subtractions on two pointers pointing to "
199            "different memory chunks">,
200   Documentation<HasAlphaDocumentation>;
201
202 def SizeofPointerChecker : Checker<"SizeofPtr">,
203   HelpText<"Warn about unintended use of sizeof() on pointer expressions">,
204   Documentation<HasAlphaDocumentation>;
205
206 def CallAndMessageUnInitRefArg : Checker<"CallAndMessageUnInitRefArg">,
207   HelpText<"Check for logical errors for function calls and Objective-C "
208            "message expressions (e.g., uninitialized arguments, null function "
209            "pointers, and pointer to undefined variables)">,
210   Dependencies<[CallAndMessageChecker]>,
211   Documentation<HasAlphaDocumentation>;
212
213 def TestAfterDivZeroChecker : Checker<"TestAfterDivZero">,
214   HelpText<"Check for division by variable that is later compared against 0. "
215            "Either the comparison is useless or there is division by zero.">,
216   Documentation<HasAlphaDocumentation>;
217
218 def DynamicTypeChecker : Checker<"DynamicTypeChecker">,
219   HelpText<"Check for cases where the dynamic and the static type of an object "
220            "are unrelated.">,
221   Documentation<HasAlphaDocumentation>;
222
223 def StackAddrAsyncEscapeChecker : Checker<"StackAddressAsyncEscape">,
224   HelpText<"Check that addresses to stack memory do not escape the function">,
225   Dependencies<[StackAddrEscapeBase]>,
226   Documentation<HasAlphaDocumentation>;
227
228 } // end "alpha.core"
229
230 //===----------------------------------------------------------------------===//
231 // Nullability checkers.
232 //===----------------------------------------------------------------------===//
233
234 let ParentPackage = Nullability in {
235
236 def NullabilityBase : Checker<"NullabilityBase">,
237   HelpText<"Stores information during the analysis about nullability.">,
238   Documentation<NotDocumented>,
239   Hidden;
240
241 def NullPassedToNonnullChecker : Checker<"NullPassedToNonnull">,
242   HelpText<"Warns when a null pointer is passed to a pointer which has a "
243            "_Nonnull type.">,
244   Dependencies<[NullabilityBase]>,
245   Documentation<HasDocumentation>;
246
247 def NullReturnedFromNonnullChecker : Checker<"NullReturnedFromNonnull">,
248   HelpText<"Warns when a null pointer is returned from a function that has "
249            "_Nonnull return type.">,
250   Dependencies<[NullabilityBase]>,
251   Documentation<HasDocumentation>;
252
253 def NullableDereferencedChecker : Checker<"NullableDereferenced">,
254   HelpText<"Warns when a nullable pointer is dereferenced.">,
255   Dependencies<[NullabilityBase]>,
256   Documentation<HasDocumentation>;
257
258 def NullablePassedToNonnullChecker : Checker<"NullablePassedToNonnull">,
259   HelpText<"Warns when a nullable pointer is passed to a pointer which has a "
260            "_Nonnull type.">,
261   Dependencies<[NullabilityBase]>,
262   Documentation<HasDocumentation>;
263
264 def NullableReturnedFromNonnullChecker : Checker<"NullableReturnedFromNonnull">,
265   HelpText<"Warns when a nullable pointer is returned from a function that has "
266            "_Nonnull return type.">,
267   Dependencies<[NullabilityBase]>,
268   Documentation<NotDocumented>;
269
270 } // end "nullability"
271
272 //===----------------------------------------------------------------------===//
273 // APIModeling.
274 //===----------------------------------------------------------------------===//
275
276 let ParentPackage = APIModeling in {
277
278 def StdCLibraryFunctionsChecker : Checker<"StdCLibraryFunctions">,
279   HelpText<"Improve modeling of the C standard library functions">,
280   Documentation<NotDocumented>;
281
282 def TrustNonnullChecker : Checker<"TrustNonnull">,
283   HelpText<"Trust that returns from framework methods annotated with _Nonnull "
284            "are not null">,
285   Documentation<NotDocumented>;
286
287 } // end "apiModeling"
288
289 //===----------------------------------------------------------------------===//
290 // Evaluate "builtin" functions.
291 //===----------------------------------------------------------------------===//
292
293 let ParentPackage = CoreBuiltin in {
294
295 def NoReturnFunctionChecker : Checker<"NoReturnFunctions">,
296   HelpText<"Evaluate \"panic\" functions that are known to not return to the "
297            "caller">,
298   Documentation<NotDocumented>;
299
300 def BuiltinFunctionChecker : Checker<"BuiltinFunctions">,
301   HelpText<"Evaluate compiler builtin functions (e.g., alloca())">,
302   Documentation<NotDocumented>;
303
304 } // end "core.builtin"
305
306 //===----------------------------------------------------------------------===//
307 // Uninitialized values checkers.
308 //===----------------------------------------------------------------------===//
309
310 let ParentPackage = CoreUninitialized in {
311
312 def UndefinedArraySubscriptChecker : Checker<"ArraySubscript">,
313   HelpText<"Check for uninitialized values used as array subscripts">,
314   Documentation<HasDocumentation>;
315
316 def UndefinedAssignmentChecker : Checker<"Assign">,
317   HelpText<"Check for assigning uninitialized values">,
318   Documentation<HasDocumentation>;
319
320 def UndefBranchChecker : Checker<"Branch">,
321   HelpText<"Check for uninitialized values used as branch conditions">,
322   Documentation<HasDocumentation>;
323
324 def UndefCapturedBlockVarChecker : Checker<"CapturedBlockVariable">,
325   HelpText<"Check for blocks that capture uninitialized values">,
326   Documentation<NotDocumented>;
327
328 def ReturnUndefChecker : Checker<"UndefReturn">,
329   HelpText<"Check for uninitialized values being returned to the caller">,
330   Documentation<HasDocumentation>;
331
332 } // end "core.uninitialized"
333
334 //===----------------------------------------------------------------------===//
335 // Unix API checkers.
336 //===----------------------------------------------------------------------===//
337
338 let ParentPackage = CString in {
339
340 def CStringModeling : Checker<"CStringModeling">,
341   HelpText<"The base of several CString related checkers. On it's own it emits "
342            "no reports, but adds valuable information to the analysis when "
343            "enabled.">,
344   Documentation<NotDocumented>,
345   Hidden;
346
347 def CStringNullArg : Checker<"NullArg">,
348   HelpText<"Check for null pointers being passed as arguments to C string "
349            "functions">,
350   Dependencies<[CStringModeling]>,
351   Documentation<HasDocumentation>;
352
353 def CStringSyntaxChecker : Checker<"BadSizeArg">,
354   HelpText<"Check the size argument passed into C string functions for common "
355            "erroneous patterns">,
356   Dependencies<[CStringModeling]>,
357   Documentation<HasDocumentation>;
358
359 } // end "unix.cstring"
360
361 let ParentPackage = CStringAlpha in {
362
363 def CStringOutOfBounds : Checker<"OutOfBounds">,
364   HelpText<"Check for out-of-bounds access in string functions">,
365   Dependencies<[CStringModeling]>,
366   Documentation<HasAlphaDocumentation>;
367
368 def CStringBufferOverlap : Checker<"BufferOverlap">,
369   HelpText<"Checks for overlap in two buffer arguments">,
370   Dependencies<[CStringModeling]>,
371   Documentation<HasAlphaDocumentation>;
372
373 def CStringNotNullTerm : Checker<"NotNullTerminated">,
374   HelpText<"Check for arguments which are not null-terminating strings">,
375   Dependencies<[CStringModeling]>,
376   Documentation<HasAlphaDocumentation>;
377
378 } // end "alpha.unix.cstring"
379
380 let ParentPackage = Unix in {
381
382 def UnixAPIMisuseChecker : Checker<"API">,
383   HelpText<"Check calls to various UNIX/Posix functions">,
384   Documentation<HasDocumentation>;
385
386 def DynamicMemoryModeling: Checker<"DynamicMemoryModeling">,
387   HelpText<"The base of several malloc() related checkers. On it's own it "
388            "emits no reports, but adds valuable information to the analysis "
389            "when enabled.">,
390   CheckerOptions<[
391     CmdLineOption<Boolean,
392                   "Optimistic",
393                   "If set to true, the checker assumes that all the "
394                   "allocating and deallocating functions are annotated with "
395                   "ownership_holds, ownership_takes and ownership_returns.",
396                   "false",
397                   InAlpha>
398   ]>,
399   Dependencies<[CStringModeling]>,
400   Documentation<NotDocumented>,
401   Hidden;
402
403 def MallocChecker: Checker<"Malloc">,
404   HelpText<"Check for memory leaks, double free, and use-after-free problems. "
405            "Traces memory managed by malloc()/free().">,
406   Dependencies<[DynamicMemoryModeling]>,
407   Documentation<HasDocumentation>;
408
409 def MallocSizeofChecker : Checker<"MallocSizeof">,
410   HelpText<"Check for dubious malloc arguments involving sizeof">,
411   Documentation<HasDocumentation>;
412
413 def MismatchedDeallocatorChecker : Checker<"MismatchedDeallocator">,
414   HelpText<"Check for mismatched deallocators.">,
415   Dependencies<[DynamicMemoryModeling]>,
416   Documentation<HasDocumentation>;
417
418 def VforkChecker : Checker<"Vfork">,
419   HelpText<"Check for proper usage of vfork">,
420   Documentation<HasDocumentation>;
421
422 } // end "unix"
423
424 let ParentPackage = UnixAlpha in {
425
426 def ChrootChecker : Checker<"Chroot">,
427   HelpText<"Check improper use of chroot">,
428   Documentation<HasAlphaDocumentation>;
429
430 def PthreadLockChecker : Checker<"PthreadLock">,
431   HelpText<"Simple lock -> unlock checker">,
432   Documentation<HasAlphaDocumentation>;
433
434 def StreamChecker : Checker<"Stream">,
435   HelpText<"Check stream handling functions">,
436   Documentation<HasAlphaDocumentation>;
437
438 def SimpleStreamChecker : Checker<"SimpleStream">,
439   HelpText<"Check for misuses of stream APIs">,
440   Documentation<HasAlphaDocumentation>;
441
442 def BlockInCriticalSectionChecker : Checker<"BlockInCriticalSection">,
443   HelpText<"Check for calls to blocking functions inside a critical section">,
444   Documentation<HasAlphaDocumentation>;
445
446 } // end "alpha.unix"
447
448 //===----------------------------------------------------------------------===//
449 // C++ checkers.
450 //===----------------------------------------------------------------------===//
451
452 let ParentPackage = Cplusplus in {
453
454 def InnerPointerChecker : Checker<"InnerPointer">,
455   HelpText<"Check for inner pointers of C++ containers used after "
456            "re/deallocation">,
457   Dependencies<[DynamicMemoryModeling]>,
458   Documentation<NotDocumented>;
459
460 def NewDeleteChecker : Checker<"NewDelete">,
461   HelpText<"Check for double-free and use-after-free problems. Traces memory "
462            "managed by new/delete.">,
463   Dependencies<[DynamicMemoryModeling]>,
464   Documentation<HasDocumentation>;
465
466 def NewDeleteLeaksChecker : Checker<"NewDeleteLeaks">,
467   HelpText<"Check for memory leaks. Traces memory managed by new/delete.">,
468   Dependencies<[NewDeleteChecker]>,
469   Documentation<HasDocumentation>;
470
471 def CXXSelfAssignmentChecker : Checker<"SelfAssignment">,
472   HelpText<"Checks C++ copy and move assignment operators for self assignment">,
473   Documentation<NotDocumented>,
474   Hidden;
475
476 def SmartPtrModeling: Checker<"SmartPtr">,
477   HelpText<"Model behavior of C++ smart pointers">,
478   Documentation<NotDocumented>,
479   Hidden;
480
481 def MoveChecker: Checker<"Move">,
482   HelpText<"Find use-after-move bugs in C++">,
483   CheckerOptions<[
484     CmdLineOption<String,
485                   "WarnOn",
486                   "In non-aggressive mode, only warn on use-after-move of "
487                   "local variables (or local rvalue references) and of STL "
488                   "objects. The former is possible because local variables (or "
489                   "local rvalue references) are not tempting their user to "
490                   "re-use the storage. The latter is possible because STL "
491                   "objects are known to end up in a valid but unspecified "
492                   "state after the move and their state-reset methods are also "
493                   "known, which allows us to predict precisely when "
494                   "use-after-move is invalid. Some STL objects are known to "
495                   "conform to additional contracts after move, so they are not "
496                   "tracked. However, smart pointers specifically are tracked "
497                   "because we can perform extra checking over them. In "
498                   "aggressive mode, warn on any use-after-move because the "
499                   "user has intentionally asked us to completely eliminate "
500                   "use-after-move in his code. Values: \"KnownsOnly\", "
501                   "\"KnownsAndLocals\", \"All\".",
502                   "KnownsAndLocals",
503                   Released>
504   ]>,
505   Documentation<HasDocumentation>;
506
507 } // end: "cplusplus"
508
509 let ParentPackage = CplusplusOptIn in {
510
511 def UninitializedObjectChecker: Checker<"UninitializedObject">,
512   HelpText<"Reports uninitialized fields after object construction">,
513   CheckerOptions<[
514     CmdLineOption<Boolean,
515                   "Pedantic",
516                   "If set to false, the checker won't emit warnings "
517                   "for objects that don't have at least one initialized "
518                   "field.",
519                   "false",
520                   Released>,
521     CmdLineOption<Boolean,
522                   "NotesAsWarnings",
523                   "If set to true, the checker will emit a warning "
524                   "for each uninitalized field, as opposed to emitting one "
525                   "warning per constructor call, and listing the uninitialized "
526                   "fields that belongs to it in notes.",
527                   "false",
528                   Released,
529                   Hide>,
530     CmdLineOption<Boolean,
531                   "CheckPointeeInitialization",
532                   "If set to false, the checker will not analyze "
533                   "the pointee of pointer/reference fields, and will only "
534                   "check whether the object itself is initialized.",
535                   "false",
536                   InAlpha>,
537     CmdLineOption<String,
538                   "IgnoreRecordsWithField",
539                   "If supplied, the checker will not analyze "
540                   "structures that have a field with a name or type name that "
541                   "matches the given pattern.",
542                   "\"\"",
543                   Released>,
544     CmdLineOption<Boolean,
545                   "IgnoreGuardedFields",
546                   "If set to true, the checker will analyze _syntactically_ "
547                   "whether the found uninitialized object is used without a "
548                   "preceding assert call. Defaults to false.",
549                   "false",
550                   InAlpha>
551   ]>,
552   Documentation<HasAlphaDocumentation>;
553
554 def VirtualCallChecker : Checker<"VirtualCall">,
555   HelpText<"Check virtual function calls during construction or destruction">,
556   CheckerOptions<[
557     CmdLineOption<Boolean,
558                   "PureOnly",
559                   "Whether to only report calls to pure virtual methods.",
560                   "false",
561                   Released>
562   ]>,
563   Documentation<HasDocumentation>;
564
565 } // end: "optin.cplusplus"
566
567 let ParentPackage = CplusplusAlpha in {
568
569 def DeleteWithNonVirtualDtorChecker : Checker<"DeleteWithNonVirtualDtor">,
570   HelpText<"Reports destructions of polymorphic objects with a non-virtual "
571            "destructor in their base class">,
572   Documentation<HasAlphaDocumentation>;
573
574 def EnumCastOutOfRangeChecker : Checker<"EnumCastOutOfRange">,
575   HelpText<"Check integer to enumeration casts for out of range values">,
576   Documentation<HasAlphaDocumentation>;
577
578 def IteratorModeling : Checker<"IteratorModeling">,
579   HelpText<"Models iterators of C++ containers">,
580   Documentation<NotDocumented>,
581   Hidden;
582
583 def InvalidatedIteratorChecker : Checker<"InvalidatedIterator">,
584   HelpText<"Check for use of invalidated iterators">,
585   Dependencies<[IteratorModeling]>,
586   Documentation<HasAlphaDocumentation>;
587
588 def IteratorRangeChecker : Checker<"IteratorRange">,
589   HelpText<"Check for iterators used outside their valid ranges">,
590   Dependencies<[IteratorModeling]>,
591   Documentation<HasAlphaDocumentation>;
592
593 def MismatchedIteratorChecker : Checker<"MismatchedIterator">,
594   HelpText<"Check for use of iterators of different containers where iterators "
595            "of the same container are expected">,
596   Dependencies<[IteratorModeling]>,
597   Documentation<HasAlphaDocumentation>;
598
599 } // end: "alpha.cplusplus"
600
601
602 //===----------------------------------------------------------------------===//
603 // Valist checkers.
604 //===----------------------------------------------------------------------===//
605
606 let ParentPackage = Valist in {
607
608 def ValistBase : Checker<"ValistBase">,
609   HelpText<"Gathers information about va_lists.">,
610   Documentation<NotDocumented>,
611   Hidden;
612
613 def UninitializedChecker : Checker<"Uninitialized">,
614   HelpText<"Check for usages of uninitialized (or already released) va_lists.">,
615   Dependencies<[ValistBase]>,
616   Documentation<NotDocumented>;
617
618 def UnterminatedChecker : Checker<"Unterminated">,
619   HelpText<"Check for va_lists which are not released by a va_end call.">,
620   Dependencies<[ValistBase]>,
621   Documentation<NotDocumented>;
622
623 def CopyToSelfChecker : Checker<"CopyToSelf">,
624   HelpText<"Check for va_lists which are copied onto itself.">,
625   Dependencies<[ValistBase]>,
626   Documentation<NotDocumented>;
627
628 } // end : "valist"
629
630 //===----------------------------------------------------------------------===//
631 // Deadcode checkers.
632 //===----------------------------------------------------------------------===//
633
634 let ParentPackage = DeadCode in {
635
636 def DeadStoresChecker : Checker<"DeadStores">,
637   HelpText<"Check for values stored to variables that are never read "
638            "afterwards">,
639   Documentation<HasDocumentation>;
640
641 } // end DeadCode
642
643 let ParentPackage = DeadCodeAlpha in {
644
645 def UnreachableCodeChecker : Checker<"UnreachableCode">,
646   HelpText<"Check unreachable code">,
647   Documentation<HasAlphaDocumentation>;
648
649 } // end "alpha.deadcode"
650
651 //===----------------------------------------------------------------------===//
652 // Performance checkers.
653 //===----------------------------------------------------------------------===//
654
655 let ParentPackage = Performance in {
656
657 def PaddingChecker : Checker<"Padding">,
658   HelpText<"Check for excessively padded structs.">,
659   CheckerOptions<[
660     CmdLineOption<Integer,
661                   "AllowedPad",
662                   "Reports are only generated if the excessive padding exceeds "
663                   "'AllowedPad' in bytes.",
664                   "24",
665                   Released>
666   ]>,
667   Documentation<NotDocumented>;
668
669 } // end: "padding"
670
671 //===----------------------------------------------------------------------===//
672 // Security checkers.
673 //===----------------------------------------------------------------------===//
674
675 let ParentPackage = InsecureAPI in {
676
677 def SecuritySyntaxChecker : Checker<"SecuritySyntaxChecker">,
678   HelpText<"Base of various security function related checkers">,
679   Documentation<NotDocumented>,
680   Hidden;
681
682 def bcmp : Checker<"bcmp">,
683   HelpText<"Warn on uses of the 'bcmp' function">,
684   Dependencies<[SecuritySyntaxChecker]>,
685   Documentation<HasDocumentation>;
686
687 def bcopy : Checker<"bcopy">,
688   HelpText<"Warn on uses of the 'bcopy' function">,
689   Dependencies<[SecuritySyntaxChecker]>,
690   Documentation<HasDocumentation>;
691
692 def bzero : Checker<"bzero">,
693   HelpText<"Warn on uses of the 'bzero' function">,
694   Dependencies<[SecuritySyntaxChecker]>,
695   Documentation<HasDocumentation>;
696
697 def gets : Checker<"gets">,
698   HelpText<"Warn on uses of the 'gets' function">,
699   Dependencies<[SecuritySyntaxChecker]>,
700   Documentation<HasDocumentation>;
701
702 def getpw : Checker<"getpw">,
703   HelpText<"Warn on uses of the 'getpw' function">,
704   Dependencies<[SecuritySyntaxChecker]>,
705   Documentation<HasDocumentation>;
706
707 def mktemp : Checker<"mktemp">,
708   HelpText<"Warn on uses of the 'mktemp' function">,
709   Dependencies<[SecuritySyntaxChecker]>,
710   Documentation<HasDocumentation>;
711
712 def mkstemp : Checker<"mkstemp">,
713   HelpText<"Warn when 'mkstemp' is passed fewer than 6 X's in the format "
714            "string">,
715   Dependencies<[SecuritySyntaxChecker]>,
716   Documentation<HasDocumentation>;
717
718 def rand : Checker<"rand">,
719   HelpText<"Warn on uses of the 'rand', 'random', and related functions">,
720   Dependencies<[SecuritySyntaxChecker]>,
721   Documentation<HasDocumentation>;
722
723 def strcpy : Checker<"strcpy">,
724   HelpText<"Warn on uses of the 'strcpy' and 'strcat' functions">,
725   Dependencies<[SecuritySyntaxChecker]>,
726   Documentation<HasDocumentation>;
727
728 def vfork : Checker<"vfork">,
729   HelpText<"Warn on uses of the 'vfork' function">,
730   Dependencies<[SecuritySyntaxChecker]>,
731   Documentation<HasDocumentation>;
732
733 def UncheckedReturn : Checker<"UncheckedReturn">,
734   HelpText<"Warn on uses of functions whose return values must be always "
735            "checked">,
736   Dependencies<[SecuritySyntaxChecker]>,
737   Documentation<HasDocumentation>;
738
739 def DeprecatedOrUnsafeBufferHandling :
740   Checker<"DeprecatedOrUnsafeBufferHandling">,
741   HelpText<"Warn on uses of unsecure or deprecated buffer manipulating "
742            "functions">,
743   Dependencies<[SecuritySyntaxChecker]>,
744   Documentation<HasDocumentation>;
745
746 } // end "security.insecureAPI"
747
748 let ParentPackage = Security in {
749
750 def FloatLoopCounter : Checker<"FloatLoopCounter">,
751   HelpText<"Warn on using a floating point value as a loop counter (CERT: "
752            "FLP30-C, FLP30-CPP)">,
753   Dependencies<[SecuritySyntaxChecker]>,
754   Documentation<HasDocumentation>;
755
756 } // end "security"
757
758 let ParentPackage = SecurityAlpha in {
759
760 def ArrayBoundChecker : Checker<"ArrayBound">,
761   HelpText<"Warn about buffer overflows (older checker)">,
762   Documentation<HasAlphaDocumentation>;
763
764 def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">,
765   HelpText<"Warn about buffer overflows (newer checker)">,
766   Documentation<HasAlphaDocumentation>;
767
768 def ReturnPointerRangeChecker : Checker<"ReturnPtrRange">,
769   HelpText<"Check for an out-of-bound pointer being returned to callers">,
770   Documentation<HasAlphaDocumentation>;
771
772 def MallocOverflowSecurityChecker : Checker<"MallocOverflow">,
773   HelpText<"Check for overflows in the arguments to malloc()">,
774   Documentation<HasAlphaDocumentation>;
775
776 def MmapWriteExecChecker : Checker<"MmapWriteExec">,
777   HelpText<"Warn on mmap() calls that are both writable and executable">,
778   CheckerOptions<[
779     CmdLineOption<Integer,
780                   "MmapProtExec",
781                   "Specifies the value of PROT_EXEC",
782                   "0x04",
783                   Released>,
784     CmdLineOption<Integer,
785                   "MmapProtRead",
786                   "Specifies the value of PROT_READ",
787                   "0x01",
788                   Released>
789   ]>,
790   Documentation<HasAlphaDocumentation>;
791
792 } // end "alpha.security"
793
794 //===----------------------------------------------------------------------===//
795 // Taint checkers.
796 //===----------------------------------------------------------------------===//
797
798 let ParentPackage = Taint in {
799
800 def GenericTaintChecker : Checker<"TaintPropagation">,
801   HelpText<"Generate taint information used by other checkers">,
802   Documentation<HasAlphaDocumentation>;
803
804 } // end "alpha.security.taint"
805
806 //===----------------------------------------------------------------------===//
807 // Mac OS X, Cocoa, and Core Foundation checkers.
808 //===----------------------------------------------------------------------===//
809
810 let ParentPackage = Cocoa in {
811
812 def RetainCountBase : Checker<"RetainCountBase">,
813   HelpText<"Common base of various retain count related checkers">,
814   Documentation<NotDocumented>,
815   Hidden;
816
817 } // end "osx.cocoa"
818
819 let ParentPackage = OSX in {
820
821 def NSOrCFErrorDerefChecker : Checker<"NSOrCFErrorDerefChecker">,
822   HelpText<"Implementation checker for NSErrorChecker and CFErrorChecker">,
823   Documentation<NotDocumented>,
824   Hidden;
825
826 def NumberObjectConversionChecker : Checker<"NumberObjectConversion">,
827   HelpText<"Check for erroneous conversions of objects representing numbers "
828            "into numbers">,
829   CheckerOptions<[
830     CmdLineOption<Boolean,
831                   "Pedantic",
832                   "Enables detection of more conversion patterns (which are "
833                   "most likely more harmless, and therefore are more likely to "
834                   "produce false positives).",
835                   "false",
836                   Released>
837   ]>,
838   Documentation<NotDocumented>;
839
840 def MacOSXAPIChecker : Checker<"API">,
841   HelpText<"Check for proper uses of various Apple APIs">,
842   Documentation<HasDocumentation>;
843
844 def MacOSKeychainAPIChecker : Checker<"SecKeychainAPI">,
845   HelpText<"Check for proper uses of Secure Keychain APIs">,
846   Documentation<HasDocumentation>;
847
848 def MIGChecker : Checker<"MIG">,
849   HelpText<"Find violations of the Mach Interface Generator "
850            "calling convention">,
851   Documentation<NotDocumented>;
852
853 def ObjCPropertyChecker : Checker<"ObjCProperty">,
854   HelpText<"Check for proper uses of Objective-C properties">,
855   Documentation<NotDocumented>;
856
857 def OSObjectRetainCountChecker : Checker<"OSObjectRetainCount">,
858   HelpText<"Check for leaks and improper reference count management for "
859            "OSObject">,
860   Dependencies<[RetainCountBase]>,
861   Documentation<NotDocumented>;
862
863 } // end "osx"
864
865 let ParentPackage = Cocoa in {
866
867 def RunLoopAutoreleaseLeakChecker : Checker<"RunLoopAutoreleaseLeak">,
868   HelpText<"Check for leaked memory in autorelease pools that will never be "
869            "drained">,
870   Documentation<NotDocumented>;
871
872 def ObjCAtSyncChecker : Checker<"AtSync">,
873   HelpText<"Check for nil pointers used as mutexes for @synchronized">,
874   Documentation<HasDocumentation>;
875
876 def NilArgChecker : Checker<"NilArg">,
877   HelpText<"Check for prohibited nil arguments to ObjC method calls">,
878   Documentation<HasDocumentation>;
879
880 def ClassReleaseChecker : Checker<"ClassRelease">,
881   HelpText<"Check for sending 'retain', 'release', or 'autorelease' directly "
882            "to a Class">,
883   Documentation<HasDocumentation>;
884
885 def VariadicMethodTypeChecker : Checker<"VariadicMethodTypes">,
886   HelpText<"Check for passing non-Objective-C types to variadic collection "
887            "initialization methods that expect only Objective-C types">,
888   Documentation<HasDocumentation>;
889
890 def NSAutoreleasePoolChecker : Checker<"NSAutoreleasePool">,
891   HelpText<"Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC "
892            "mode">,
893   Documentation<HasDocumentation>;
894
895 def ObjCMethSigsChecker : Checker<"IncompatibleMethodTypes">,
896   HelpText<"Warn about Objective-C method signatures with type "
897            "incompatibilities">,
898   Documentation<HasDocumentation>;
899
900 def ObjCUnusedIvarsChecker : Checker<"UnusedIvars">,
901   HelpText<"Warn about private ivars that are never used">,
902   Documentation<HasDocumentation>;
903
904 def ObjCSelfInitChecker : Checker<"SelfInit">,
905   HelpText<"Check that 'self' is properly initialized inside an initializer "
906            "method">,
907   Documentation<HasDocumentation>;
908
909 def ObjCLoopChecker : Checker<"Loops">,
910   HelpText<"Improved modeling of loops using Cocoa collection types">,
911   Documentation<NotDocumented>;
912
913 def ObjCNonNilReturnValueChecker : Checker<"NonNilReturnValue">,
914   HelpText<"Model the APIs that are guaranteed to return a non-nil value">,
915   Documentation<NotDocumented>;
916
917 def ObjCSuperCallChecker : Checker<"MissingSuperCall">,
918   HelpText<"Warn about Objective-C methods that lack a necessary call to "
919            "super">,
920   Documentation<NotDocumented>;
921
922 def NSErrorChecker : Checker<"NSError">,
923   HelpText<"Check usage of NSError** parameters">,
924   Dependencies<[NSOrCFErrorDerefChecker]>,
925   Documentation<HasDocumentation>;
926
927 def RetainCountChecker : Checker<"RetainCount">,
928   HelpText<"Check for leaks and improper reference count management">,
929   CheckerOptions<[
930     CmdLineOption<Boolean,
931                   "CheckOSObject",
932                   "Find violations of retain-release rules applied to XNU "
933                   "OSObject instances. By default, the checker only checks "
934                   "retain-release rules for Objective-C NSObject instances "
935                   "and CoreFoundation objects.",
936                   "true",
937                   InAlpha,
938                   Hide>,
939     CmdLineOption<Boolean,
940                   "TrackNSCFStartParam",
941                   "Check not only that the code follows retain-release rules "
942                   "with respect to objects it allocates or borrows from "
943                   "elsewhere, but also that it fulfills its own retain count "
944                   "specification with respect to objects that it receives as "
945                   "arguments.",
946                   "false",
947                   Released>
948   ]>,
949   Dependencies<[RetainCountBase]>,
950   Documentation<HasDocumentation>;
951
952 def ObjCGenericsChecker : Checker<"ObjCGenerics">,
953   HelpText<"Check for type errors when using Objective-C generics">,
954   Dependencies<[DynamicTypePropagation]>,
955   Documentation<HasDocumentation>;
956
957 def ObjCDeallocChecker : Checker<"Dealloc">,
958   HelpText<"Warn about Objective-C classes that lack a correct implementation "
959            "of -dealloc">,
960   Documentation<HasDocumentation>;
961
962 def ObjCSuperDeallocChecker : Checker<"SuperDealloc">,
963   HelpText<"Warn about improper use of '[super dealloc]' in Objective-C">,
964   Documentation<HasDocumentation>;
965
966 def AutoreleaseWriteChecker : Checker<"AutoreleaseWrite">,
967   HelpText<"Warn about potentially crashing writes to autoreleasing objects "
968            "from different autoreleasing pools in Objective-C">,
969   Documentation<NotDocumented>;
970
971 } // end "osx.cocoa"
972
973 let ParentPackage = Performance in {
974
975 def GCDAntipattern : Checker<"GCDAntipattern">,
976   HelpText<"Check for performance anti-patterns when using Grand Central "
977            "Dispatch">,
978   Documentation<NotDocumented>;
979 } // end "optin.performance"
980
981 let ParentPackage = OSXOptIn in {
982
983 def OSObjectCStyleCast : Checker<"OSObjectCStyleCast">,
984   HelpText<"Checker for C-style casts of OSObjects">,
985   Documentation<NotDocumented>;
986
987 } // end "optin.osx"
988
989 let ParentPackage = CocoaAlpha in {
990
991 def IvarInvalidationModeling : Checker<"IvarInvalidationModeling">,
992   HelpText<"Gathers information for annotation driven invalidation checking "
993            "for classes that contains a method annotated with "
994            "'objc_instance_variable_invalidator'">,
995   Documentation<NotDocumented>,
996   Hidden;
997
998 def InstanceVariableInvalidation : Checker<"InstanceVariableInvalidation">,
999   HelpText<"Check that the invalidatable instance variables are invalidated in "
1000            "the methods annotated with objc_instance_variable_invalidator">,
1001   Dependencies<[IvarInvalidationModeling]>,
1002   Documentation<HasAlphaDocumentation>;
1003
1004 def MissingInvalidationMethod : Checker<"MissingInvalidationMethod">,
1005   HelpText<"Check that the invalidation methods are present in classes that "
1006            "contain invalidatable instance variables">,
1007   Dependencies<[IvarInvalidationModeling]>,
1008   Documentation<HasAlphaDocumentation>;
1009
1010 def DirectIvarAssignment : Checker<"DirectIvarAssignment">,
1011   HelpText<"Check for direct assignments to instance variables">,
1012   Documentation<HasAlphaDocumentation>;
1013
1014 def DirectIvarAssignmentForAnnotatedFunctions :
1015   Checker<"DirectIvarAssignmentForAnnotatedFunctions">,
1016   HelpText<"Check for direct assignments to instance variables in the methods "
1017            "annotated with objc_no_direct_instance_variable_assignment">,
1018   Dependencies<[DirectIvarAssignment]>,
1019   Documentation<HasAlphaDocumentation>;
1020
1021 } // end "alpha.osx.cocoa"
1022
1023 let ParentPackage = CoreFoundation in {
1024
1025 def CFNumberChecker : Checker<"CFNumber">,
1026   HelpText<"Check for proper uses of CFNumber APIs">,
1027   Documentation<HasDocumentation>;
1028
1029 def CFRetainReleaseChecker : Checker<"CFRetainRelease">,
1030   HelpText<"Check for null arguments to CFRetain/CFRelease/CFMakeCollectable">,
1031   Documentation<HasDocumentation>;
1032
1033 def CFErrorChecker : Checker<"CFError">,
1034   HelpText<"Check usage of CFErrorRef* parameters">,
1035   Dependencies<[NSOrCFErrorDerefChecker]>,
1036   Documentation<HasDocumentation>;
1037
1038 } // end "osx.coreFoundation"
1039
1040 let ParentPackage = Containers in {
1041
1042 def ObjCContainersASTChecker : Checker<"PointerSizedValues">,
1043   HelpText<"Warns if 'CFArray', 'CFDictionary', 'CFSet' are created with "
1044            "non-pointer-size values">,
1045   Documentation<HasDocumentation>;
1046
1047 def ObjCContainersChecker : Checker<"OutOfBounds">,
1048   HelpText<"Checks for index out-of-bounds when using 'CFArray' API">,
1049   Documentation<HasDocumentation>;
1050
1051 } // end "osx.coreFoundation.containers"
1052
1053 let ParentPackage = LocalizabilityOptIn in {
1054
1055 def NonLocalizedStringChecker : Checker<"NonLocalizedStringChecker">,
1056   HelpText<"Warns about uses of non-localized NSStrings passed to UI methods "
1057            "expecting localized NSStrings">,
1058   CheckerOptions<[
1059     CmdLineOption<Boolean,
1060                   "AggressiveReport",
1061                   "Marks a string being returned by any call as localized if "
1062                   "it is in LocStringFunctions (LSF) or the function is "
1063                   "annotated. Otherwise, we mark it as NonLocalized "
1064                   "(Aggressive) or NonLocalized only if it is not backed by a "
1065                   "SymRegion (Non-Aggressive), basically leaving only string "
1066                   "literals as NonLocalized.",
1067                   "false",
1068                   InAlpha,
1069                   Hide>
1070   ]>,
1071   Documentation<HasDocumentation>;
1072
1073 def EmptyLocalizationContextChecker :
1074   Checker<"EmptyLocalizationContextChecker">,
1075   HelpText<"Check that NSLocalizedString macros include a comment for context">,
1076   Documentation<HasDocumentation>;
1077
1078 } // end "optin.osx.cocoa.localizability"
1079
1080 let ParentPackage = LocalizabilityAlpha in {
1081
1082 def PluralMisuseChecker : Checker<"PluralMisuseChecker">,
1083   HelpText<"Warns against using one vs. many plural pattern in code when "
1084            "generating localized strings.">,
1085   Documentation<HasAlphaDocumentation>;
1086
1087 } // end "alpha.osx.cocoa.localizability"
1088
1089 let ParentPackage = MPI in {
1090
1091 def MPIChecker : Checker<"MPI-Checker">,
1092   HelpText<"Checks MPI code">,
1093   Documentation<HasDocumentation>;
1094
1095 } // end "optin.mpi"
1096
1097 //===----------------------------------------------------------------------===//
1098 // Checkers for LLVM development.
1099 //===----------------------------------------------------------------------===//
1100
1101 let ParentPackage = LLVMAlpha in {
1102
1103 def LLVMConventionsChecker : Checker<"Conventions">,
1104   HelpText<"Check code for LLVM codebase conventions">,
1105   Documentation<HasAlphaDocumentation>;
1106
1107 } // end "llvm"
1108
1109 let ParentPackage = LLVMAPIModeling in {
1110
1111 def CastValueChecker : Checker<"CastValue">,
1112   HelpText<"Model implementation of custom RTTIs">,
1113   Documentation<NotDocumented>;
1114
1115 def ReturnValueChecker : Checker<"ReturnValue">,
1116   HelpText<"Model the guaranteed boolean return value of function calls">,
1117   Documentation<NotDocumented>;
1118
1119 } // end "apiModeling.llvm"
1120
1121 //===----------------------------------------------------------------------===//
1122 // Checkers modeling Google APIs.
1123 //===----------------------------------------------------------------------===//
1124
1125 let ParentPackage = GoogleAPIModeling in {
1126
1127 def GTestChecker : Checker<"GTest">,
1128   HelpText<"Model gtest assertion APIs">,
1129   Documentation<NotDocumented>;
1130
1131 } // end "apiModeling.google"
1132
1133 //===----------------------------------------------------------------------===//
1134 // Debugging checkers (for analyzer development).
1135 //===----------------------------------------------------------------------===//
1136
1137 let ParentPackage = Debug in {
1138
1139 def AnalysisOrderChecker : Checker<"AnalysisOrder">,
1140   HelpText<"Print callbacks that are called during analysis in order">,
1141   CheckerOptions<[
1142     CmdLineOption<Boolean,
1143                   "PreStmtCastExpr",
1144                   "",
1145                   "false",
1146                   Released,
1147                   Hide>,
1148     CmdLineOption<Boolean,
1149                   "PostStmtCastExpr",
1150                   "",
1151                   "false",
1152                   Released,
1153                   Hide>,
1154     CmdLineOption<Boolean,
1155                   "PreStmtArraySubscriptExpr",
1156                   "",
1157                   "false",
1158                   Released,
1159                   Hide>,
1160     CmdLineOption<Boolean,
1161                   "PostStmtArraySubscriptExpr",
1162                   "",
1163                   "false",
1164                   Released,
1165                   Hide>,
1166     CmdLineOption<Boolean,
1167                   "PreStmtCXXNewExpr",
1168                   "",
1169                   "false",
1170                   Released,
1171                   Hide>,
1172     CmdLineOption<Boolean,
1173                   "PostStmtCXXNewExpr",
1174                   "",
1175                   "false",
1176                   Released,
1177                   Hide>,
1178     CmdLineOption<Boolean,
1179                   "PreStmtOffsetOfExpr",
1180                   "",
1181                   "false",
1182                   Released,
1183                   Hide>,
1184     CmdLineOption<Boolean,
1185                   "PostStmtOffsetOfExpr",
1186                   "",
1187                   "false",
1188                   Released,
1189                   Hide>,
1190     CmdLineOption<Boolean,
1191                   "PreCall",
1192                   "",
1193                   "false",
1194                   Released,
1195                   Hide>,
1196     CmdLineOption<Boolean,
1197                   "PostCall",
1198                   "",
1199                   "false",
1200                   Released,
1201                   Hide>,
1202     CmdLineOption<Boolean,
1203                   "EndFunction",
1204                   "",
1205                   "false",
1206                   Released,
1207                   Hide>,
1208     CmdLineOption<Boolean,
1209                   "NewAllocator",
1210                   "",
1211                   "false",
1212                   Released,
1213                   Hide>,
1214     CmdLineOption<Boolean,
1215                   "Bind",
1216                   "",
1217                   "false",
1218                   Released,
1219                   Hide>,
1220     CmdLineOption<Boolean,
1221                   "LiveSymbols",
1222                   "",
1223                   "false",
1224                   Released,
1225                   Hide>,
1226     CmdLineOption<Boolean,
1227                   "RegionChanges",
1228                   "",
1229                   "false",
1230                   Released,
1231                   Hide>,
1232     CmdLineOption<Boolean,
1233                   "*",
1234                   "Enables all callbacks.",
1235                   "false",
1236                   Released,
1237                   Hide>
1238   ]>,
1239   Documentation<NotDocumented>;
1240
1241 def DominatorsTreeDumper : Checker<"DumpDominators">,
1242   HelpText<"Print the dominance tree for a given CFG">,
1243   Documentation<NotDocumented>;
1244
1245 def PostDominatorsTreeDumper : Checker<"DumpPostDominators">,
1246   HelpText<"Print the post dominance tree for a given CFG">,
1247   Documentation<NotDocumented>;
1248
1249 def ControlDependencyTreeDumper : Checker<"DumpControlDependencies">,
1250   HelpText<"Print the post control dependency tree for a given CFG">,
1251   Documentation<NotDocumented>;
1252
1253 def LiveVariablesDumper : Checker<"DumpLiveVars">,
1254   HelpText<"Print results of live variable analysis">,
1255   Documentation<NotDocumented>;
1256
1257 def LiveStatementsDumper : Checker<"DumpLiveStmts">,
1258   HelpText<"Print results of live statement analysis">,
1259   Documentation<NotDocumented>;
1260
1261 def CFGViewer : Checker<"ViewCFG">,
1262   HelpText<"View Control-Flow Graphs using GraphViz">,
1263   Documentation<NotDocumented>;
1264
1265 def CFGDumper : Checker<"DumpCFG">,
1266   HelpText<"Display Control-Flow Graphs">,
1267   Documentation<NotDocumented>;
1268
1269 def CallGraphViewer : Checker<"ViewCallGraph">,
1270   HelpText<"View Call Graph using GraphViz">,
1271   Documentation<NotDocumented>;
1272
1273 def CallGraphDumper : Checker<"DumpCallGraph">,
1274   HelpText<"Display Call Graph">,
1275   Documentation<NotDocumented>;
1276
1277 def ConfigDumper : Checker<"ConfigDumper">,
1278   HelpText<"Dump config table">,
1279   Documentation<NotDocumented>;
1280
1281 def TraversalDumper : Checker<"DumpTraversal">,
1282   HelpText<"Print branch conditions as they are traversed by the engine">,
1283   Documentation<NotDocumented>;
1284
1285 def CallDumper : Checker<"DumpCalls">,
1286   HelpText<"Print calls as they are traversed by the engine">,
1287   Documentation<NotDocumented>;
1288
1289 def AnalyzerStatsChecker : Checker<"Stats">,
1290   HelpText<"Emit warnings with analyzer statistics">,
1291   Documentation<NotDocumented>;
1292
1293 def TaintTesterChecker : Checker<"TaintTest">,
1294   HelpText<"Mark tainted symbols as such.">,
1295   Documentation<NotDocumented>;
1296
1297 def ExprInspectionChecker : Checker<"ExprInspection">,
1298   HelpText<"Check the analyzer's understanding of expressions">,
1299   Documentation<NotDocumented>;
1300
1301 def ExplodedGraphViewer : Checker<"ViewExplodedGraph">,
1302   HelpText<"View Exploded Graphs using GraphViz">,
1303   Documentation<NotDocumented>;
1304
1305 def ReportStmts : Checker<"ReportStmts">,
1306   HelpText<"Emits a warning for every statement.">,
1307   Documentation<NotDocumented>;
1308
1309 } // end "debug"
1310
1311
1312 //===----------------------------------------------------------------------===//
1313 // Clone Detection
1314 //===----------------------------------------------------------------------===//
1315
1316 let ParentPackage = CloneDetectionAlpha in {
1317
1318 def CloneChecker : Checker<"CloneChecker">,
1319   HelpText<"Reports similar pieces of code.">,
1320   CheckerOptions<[
1321     CmdLineOption<Integer,
1322                   "MinimumCloneComplexity",
1323                   "Ensures that every clone has at least the given complexity. "
1324                   "Complexity is here defined as the total amount of children "
1325                   "of a statement. This constraint assumes the first statement "
1326                   "in the group is representative for all other statements in "
1327                   "the group in terms of complexity.",
1328                   "50",
1329                   Released>,
1330     CmdLineOption<Boolean,
1331                   "ReportNormalClones",
1332                   "Report all clones, even less suspicious ones.",
1333                   "true",
1334                   Released>,
1335     CmdLineOption<String,
1336                   "IgnoredFilesPattern",
1337                   "If supplied, the checker wont analyze files with a filename "
1338                   "that matches the given pattern.",
1339                   "\"\"",
1340                   Released>
1341   ]>,
1342   Documentation<HasAlphaDocumentation>;
1343
1344 } // end "clone"
1345
1346 //===----------------------------------------------------------------------===//
1347 // Portability checkers.
1348 //===----------------------------------------------------------------------===//
1349
1350 let ParentPackage = PortabilityOptIn in {
1351
1352 def UnixAPIPortabilityChecker : Checker<"UnixAPI">,
1353   HelpText<"Finds implementation-defined behavior in UNIX/Posix functions">,
1354   Documentation<NotDocumented>;
1355
1356 } // end optin.portability
1357
1358 //===----------------------------------------------------------------------===//
1359 // NonDeterminism checkers.
1360 //===----------------------------------------------------------------------===//
1361
1362 let ParentPackage = NonDeterminismAlpha in {
1363
1364 def PointerIterationChecker : Checker<"PointerIteration">,
1365   HelpText<"Checks for non-determinism caused by iteration of unordered containers of pointers">,
1366   Documentation<HasDocumentation>;
1367
1368 def PointerSortingChecker : Checker<"PointerSorting">,
1369   HelpText<"Check for non-determinism caused by sorting of pointers">,
1370   Documentation<HasDocumentation>;
1371
1372 } // end alpha.nondeterminism