diff options
Diffstat (limited to 'include/clang/StaticAnalyzer/Checkers/CheckerBase.td')
| -rw-r--r-- | include/clang/StaticAnalyzer/Checkers/CheckerBase.td | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/include/clang/StaticAnalyzer/Checkers/CheckerBase.td b/include/clang/StaticAnalyzer/Checkers/CheckerBase.td index 11f1e5d4bd51..453e189fccb0 100644 --- a/include/clang/StaticAnalyzer/Checkers/CheckerBase.td +++ b/include/clang/StaticAnalyzer/Checkers/CheckerBase.td @@ -11,29 +11,47 @@ // //===----------------------------------------------------------------------===// -class CheckerGroup<string name> { - string GroupName = name; -} -class InGroup<CheckerGroup G> { CheckerGroup Group = G; } - +/// Describes a package. Every checker is a part of a package, for example, +/// 'NullDereference' is part of the 'core' package, hence it's full name is +/// 'core.NullDereference'. +/// Example: +/// def Core : Package<"core">; class Package<string name> { string PackageName = name; - bit Hidden = 0; Package ParentPackage; - CheckerGroup Group; } -class InPackage<Package P> { Package ParentPackage = P; } -// All checkers are an indirect subclass of this. +/// Describes a 'super' package that holds another package inside it. This is +/// used to nest packages in one another. One may, for example, create the +/// 'builtin' package inside 'core', thus creating the package 'core.builtin'. +/// Example: +/// def CoreBuiltin : Package<"builtin">, ParentPackage<Core>; +class ParentPackage<Package P> { Package ParentPackage = P; } + +/// A description. May be displayed to the user when clang is invoked with +/// a '-help'-like command line option. +class HelpText<string text> { string HelpText = text; } + +/// Describes what kind of documentation exists for the checker. +class DocumentationEnum<bits<2> val> { + bits<2> Documentation = val; +} +def NotDocumented : DocumentationEnum<0>; +def HasDocumentation : DocumentationEnum<1>; +def HasAlphaDocumentation : DocumentationEnum<2>; + +class Documentation<DocumentationEnum val> { + bits<2> Documentation = val.Documentation; +} + +/// Describes a checker. Every builtin checker has to be registered with the use +/// of this class (out-of-trunk checkers loaded from plugins obviously don't). +/// Note that a checker has a name (e.g.: 'NullDereference'), and a fullname, +/// that is autogenerated with the help of the ParentPackage field, that also +/// includes package names (e.g.: 'core.NullDereference'). class Checker<string name = ""> { string CheckerName = name; - string DescFile; string HelpText; - bit Hidden = 0; + bits<2> Documentation; Package ParentPackage; - CheckerGroup Group; } - -class DescFile<string filename> { string DescFile = filename; } -class HelpText<string text> { string HelpText = text; } -class Hidden { bit Hidden = 1; } |
