CheckerOptInfo.h revision 08b86531ade68727c56918f162816075b87c864a
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
15namespace clang {
16namespace ento {
17
18class CheckerOptInfo {
19  StringRef Name;
20  bool Enable;
21  bool Claimed;
22
23public:
24  CheckerOptInfo(StringRef name, bool enable)
25    : Name(name), Enable(enable), Claimed(false) { }
26
27  StringRef getName() const { return Name; }
28  bool isEnabled() const { return Enable; }
29  bool isDisabled() const { return !isEnabled(); }
30
31  bool isClaimed() const { return Claimed; }
32  bool isUnclaimed() const { return !isClaimed(); }
33  void claim() { Claimed = true; }
34};
35
36} // end namespace ento
37} // end namespace clang
38
39#endif
40//===--- CheckerOptInfo.h - Specifies which checkers to use -----*- C++ -*-===//
41//
42//                     The LLVM Compiler Infrastructure
43//
44// This file is distributed under the University of Illinois Open Source
45// License. See LICENSE.TXT for details.
46//
47//===----------------------------------------------------------------------===//
48
49#ifndef LLVM_CLANG_STATICANALYZER_CORE_CHECKEROPTINFO_H
50#define LLVM_CLANG_STATICANALYZER_CORE_CHECKEROPTINFO_H
51
52#include "clang/Basic/LLVM.h"
53
54namespace clang {
55namespace ento {
56
57class CheckerOptInfo {
58  StringRef Name;
59  bool Enable;
60  bool Claimed;
61
62public:
63  CheckerOptInfo(StringRef name, bool enable)
64    : Name(name), Enable(enable), Claimed(false) { }
65
66  StringRef getName() const { return Name; }
67  bool isEnabled() const { return Enable; }
68  bool isDisabled() const { return !isEnabled(); }
69
70  bool isClaimed() const { return Claimed; }
71  bool isUnclaimed() const { return !isClaimed(); }
72  void claim() { Claimed = true; }
73};
74
75} // end namespace ento
76} // end namespace clang
77
78#endif
79