]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/SanitizerSpecialCaseList.h
Upgrade Unbound to 1.6.6. More to follow.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Basic / SanitizerSpecialCaseList.h
1 //===--- SanitizerSpecialCaseList.h - SCL for sanitizers --------*- 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 // An extension of SpecialCaseList to allowing querying sections by
11 // SanitizerMask.
12 //
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
15 #define LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
16
17 #include "clang/Basic/LLVM.h"
18 #include "clang/Basic/Sanitizers.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Support/SpecialCaseList.h"
21 #include <memory>
22
23 namespace clang {
24
25 class SanitizerSpecialCaseList : public llvm::SpecialCaseList {
26 public:
27   static std::unique_ptr<SanitizerSpecialCaseList>
28   create(const std::vector<std::string> &Paths, std::string &Error);
29
30   static std::unique_ptr<SanitizerSpecialCaseList>
31   createOrDie(const std::vector<std::string> &Paths);
32
33   // Query blacklisted entries if any bit in Mask matches the entry's section.
34   bool inSection(SanitizerMask Mask, StringRef Prefix, StringRef Query,
35                  StringRef Category = StringRef()) const;
36
37 protected:
38   // Initialize SanitizerSections.
39   void createSanitizerSections();
40
41   struct SanitizerSection {
42     SanitizerSection(SanitizerMask SM, SectionEntries &E)
43         : Mask(SM), Entries(E){};
44
45     SanitizerMask Mask;
46     SectionEntries &Entries;
47   };
48
49   std::vector<SanitizerSection> SanitizerSections;
50 };
51
52 } // end namespace clang
53
54 #endif