]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerOptInfo.h
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.git] / contrib / llvm / tools / clang / include / clang / StaticAnalyzer / Core / CheckerOptInfo.h
1 //===--- CheckerOptInfo.h - Specifies which checkers to use -----*- C++ -*-===//
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 #ifndef LLVM_CLANG_STATICANALYZER_CORE_CHECKEROPTINFO_H
11 #define LLVM_CLANG_STATICANALYZER_CORE_CHECKEROPTINFO_H
12
13 #include "clang/Basic/LLVM.h"
14
15 namespace clang {
16 namespace ento {
17
18 /// Represents a request to include or exclude a checker or package from a
19 /// specific analysis run.
20 ///
21 /// \sa CheckerRegistry::initializeManager
22 class CheckerOptInfo {
23   StringRef Name;
24   bool Enable;
25   bool Claimed;
26
27 public:
28   CheckerOptInfo(StringRef name, bool enable)
29     : Name(name), Enable(enable), Claimed(false) { }
30   
31   StringRef getName() const { return Name; }
32   bool isEnabled() const { return Enable; }
33   bool isDisabled() const { return !isEnabled(); }
34
35   bool isClaimed() const { return Claimed; }
36   bool isUnclaimed() const { return !isClaimed(); }
37   void claim() { Claimed = true; }
38 };
39
40 } // end namespace ento
41 } // end namespace clang
42
43 #endif