clang API Documentation

Sanitizers.h
Go to the documentation of this file.
00001 //===--- Sanitizers.h - C Language Family Language Options ------*- 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 /// \file
00011 /// \brief Defines the clang::SanitizerKind enum.
00012 ///
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_CLANG_BASIC_SANITIZERS_H
00016 #define LLVM_CLANG_BASIC_SANITIZERS_H
00017 
00018 namespace clang {
00019 
00020 enum class SanitizerKind {
00021 #define SANITIZER(NAME, ID) ID,
00022 #include "clang/Basic/Sanitizers.def"
00023   Unknown
00024 };
00025 
00026 class SanitizerSet {
00027   /// \brief Bitmask of enabled sanitizers.
00028   unsigned Kinds;
00029 public:
00030   SanitizerSet();
00031 
00032   /// \brief Check if a certain sanitizer is enabled.
00033   bool has(SanitizerKind K) const;
00034 
00035   /// \brief Enable or disable a certain sanitizer.
00036   void set(SanitizerKind K, bool Value);
00037 
00038   /// \brief Disable all sanitizers.
00039   void clear();
00040 
00041   /// \brief Returns true if at least one sanitizer is enabled.
00042   bool empty() const;
00043 };
00044 
00045 }  // end namespace clang
00046 
00047 #endif