1 //===--- CheckerBase.td - Checker TableGen classes ------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the TableGen core definitions for checkers
12 //===----------------------------------------------------------------------===//
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'.
18 /// def Core : Package<"core">;
19 class Package<string name> {
20 string PackageName = name;
21 Package ParentPackage;
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'.
28 /// def CoreBuiltin : Package<"builtin">, ParentPackage<Core>;
29 class ParentPackage<Package P> { Package ParentPackage = P; }
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; }
35 /// Describes what kind of documentation exists for the checker.
36 class DocumentationEnum<bits<2> val> {
37 bits<2> Documentation = val;
39 def NotDocumented : DocumentationEnum<0>;
40 def HasDocumentation : DocumentationEnum<1>;
41 def HasAlphaDocumentation : DocumentationEnum<2>;
43 class Documentation<DocumentationEnum val> {
44 bits<2> Documentation = val.Documentation;
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;
55 bits<2> Documentation;
56 Package ParentPackage;