clang API Documentation
00001 //===--- CheckerOptInfo.h - Specifies which checkers to use -----*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #ifndef LLVM_CLANG_STATICANALYZER_CORE_CHECKEROPTINFO_H 00011 #define LLVM_CLANG_STATICANALYZER_CORE_CHECKEROPTINFO_H 00012 00013 #include "clang/Basic/LLVM.h" 00014 #include "llvm/ADT/StringRef.h" 00015 00016 namespace clang { 00017 namespace ento { 00018 00019 /// Represents a request to include or exclude a checker or package from a 00020 /// specific analysis run. 00021 /// 00022 /// \sa CheckerRegistry::initializeManager 00023 class CheckerOptInfo { 00024 StringRef Name; 00025 bool Enable; 00026 bool Claimed; 00027 00028 public: 00029 CheckerOptInfo(StringRef name, bool enable) 00030 : Name(name), Enable(enable), Claimed(false) { } 00031 00032 StringRef getName() const { return Name; } 00033 bool isEnabled() const { return Enable; } 00034 bool isDisabled() const { return !isEnabled(); } 00035 00036 bool isClaimed() const { return Claimed; } 00037 bool isUnclaimed() const { return !isClaimed(); } 00038 void claim() { Claimed = true; } 00039 }; 00040 00041 } // end namespace ento 00042 } // end namespace clang 00043 00044 #endif