clang API Documentation

CheckerOptInfo.h
Go to the documentation of this file.
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 
00015 namespace clang {
00016 namespace ento {
00017 
00018 /// Represents a request to include or exclude a checker or package from a
00019 /// specific analysis run.
00020 ///
00021 /// \sa CheckerRegistry::initializeManager
00022 class CheckerOptInfo {
00023   StringRef Name;
00024   bool Enable;
00025   bool Claimed;
00026 
00027 public:
00028   CheckerOptInfo(StringRef name, bool enable)
00029     : Name(name), Enable(enable), Claimed(false) { }
00030   
00031   StringRef getName() const { return Name; }
00032   bool isEnabled() const { return Enable; }
00033   bool isDisabled() const { return !isEnabled(); }
00034 
00035   bool isClaimed() const { return Claimed; }
00036   bool isUnclaimed() const { return !isClaimed(); }
00037   void claim() { Claimed = true; }
00038 };
00039 
00040 } // end namespace ento
00041 } // end namespace clang
00042 
00043 #endif