1 //===--- Sanitizers.cpp - C Language Family Language Options ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the classes from Sanitizers.h
12 //===----------------------------------------------------------------------===//
13 #include "clang/Basic/Sanitizers.h"
15 using namespace clang;
17 SanitizerSet::SanitizerSet() : Kinds(0) {}
19 bool SanitizerSet::has(SanitizerKind K) const {
20 unsigned Bit = static_cast<unsigned>(K);
21 return Kinds & (1 << Bit);
24 void SanitizerSet::set(SanitizerKind K, bool Value) {
25 unsigned Bit = static_cast<unsigned>(K);
26 Kinds = Value ? (Kinds | (1 << Bit)) : (Kinds & ~(1 << Bit));
29 void SanitizerSet::clear() {
33 bool SanitizerSet::empty() const {