1 //===--- SanitizerSpecialCaseList.h - SCL for sanitizers --------*- 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 // An extension of SpecialCaseList to allowing querying sections by
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
15 #define LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
17 #include "clang/Basic/LLVM.h"
18 #include "clang/Basic/Sanitizers.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Support/SpecialCaseList.h"
25 class SanitizerSpecialCaseList : public llvm::SpecialCaseList {
27 static std::unique_ptr<SanitizerSpecialCaseList>
28 create(const std::vector<std::string> &Paths, std::string &Error);
30 static std::unique_ptr<SanitizerSpecialCaseList>
31 createOrDie(const std::vector<std::string> &Paths);
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;
38 // Initialize SanitizerSections.
39 void createSanitizerSections();
41 struct SanitizerSection {
42 SanitizerSection(SanitizerMask SM, SectionEntries &E)
43 : Mask(SM), Entries(E){};
46 SectionEntries &Entries;
49 std::vector<SanitizerSection> SanitizerSections;
52 } // end namespace clang