1 //===--- Sanitizers.h - C Language Family Language Options ------*- 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 /// \file 11 /// \brief Defines the clang::SanitizerKind enum. 12 /// 13 //===----------------------------------------------------------------------===// 14 15 #ifndef LLVM_CLANG_BASIC_SANITIZERS_H 16 #define LLVM_CLANG_BASIC_SANITIZERS_H 17 18 namespace clang { 19 20 enum class SanitizerKind { 21 #define SANITIZER(NAME, ID) ID, 22 #include "clang/Basic/Sanitizers.def" 23 Unknown 24 }; 25 26 class SanitizerSet { 27 /// \brief Bitmask of enabled sanitizers. 28 unsigned Kinds; 29 public: 30 SanitizerSet(); 31 32 /// \brief Check if a certain sanitizer is enabled. 33 bool has(SanitizerKind K) const; 34 35 /// \brief Enable or disable a certain sanitizer. 36 void set(SanitizerKind K, bool Value); 37 38 /// \brief Disable all sanitizers. 39 void clear(); 40 41 /// \brief Returns true if at least one sanitizer is enabled. 42 bool empty() const; 43 }; 44 45 } // end namespace clang 46 47 #endif 48