]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / StaticAnalyzer / Checkers / CheckerBase.td
1 //===--- CheckerBase.td - Checker TableGen classes ------------------------===//
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 //  This file defines the TableGen core definitions for checkers
11 //
12 //===----------------------------------------------------------------------===//
13
14 /// Describes a package. Every checker is a part of a package, for example,
15 /// 'NullDereference' is part of the 'core' package, hence it's full name is
16 /// 'core.NullDereference'.
17 /// Example:
18 ///   def Core : Package<"core">;
19 class Package<string name> {
20   string       PackageName = name;
21   Package ParentPackage;
22 }
23
24 /// Describes a 'super' package that holds another package inside it. This is
25 /// used to nest packages in one another. One may, for example, create the
26 /// 'builtin' package inside 'core', thus creating the package 'core.builtin'.
27 /// Example:
28 ///   def CoreBuiltin : Package<"builtin">, ParentPackage<Core>;
29 class ParentPackage<Package P> { Package ParentPackage = P; }
30
31 /// A description. May be displayed to the user when clang is invoked with
32 /// a '-help'-like command line option.
33 class HelpText<string text> { string HelpText = text; }
34
35 /// Describes what kind of documentation exists for the checker.
36 class DocumentationEnum<bits<2> val> {
37   bits<2> Documentation = val;
38 }
39 def NotDocumented : DocumentationEnum<0>;
40 def HasDocumentation : DocumentationEnum<1>;
41 def HasAlphaDocumentation : DocumentationEnum<2>;
42
43 class Documentation<DocumentationEnum val> {
44   bits<2> Documentation = val.Documentation;
45 }
46
47 /// Describes a checker. Every builtin checker has to be registered with the use
48 /// of this class (out-of-trunk checkers loaded from plugins obviously don't).
49 /// Note that a checker has a name (e.g.: 'NullDereference'), and a fullname,
50 /// that is autogenerated with the help of the ParentPackage field, that also
51 /// includes package names (e.g.: 'core.NullDereference').
52 class Checker<string name = ""> {
53   string      CheckerName = name;
54   string      HelpText;
55   bits<2>     Documentation;
56   Package ParentPackage;
57 }