1 //===--- SanitizerSpecialCaseList.h - SCL for sanitizers --------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // An extension of SpecialCaseList to allowing querying sections by
12 //===----------------------------------------------------------------------===//
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"
32 class SanitizerSpecialCaseList : public llvm::SpecialCaseList {
34 static std::unique_ptr<SanitizerSpecialCaseList>
35 create(const std::vector<std::string> &Paths, llvm::vfs::FileSystem &VFS,
38 static std::unique_ptr<SanitizerSpecialCaseList>
39 createOrDie(const std::vector<std::string> &Paths,
40 llvm::vfs::FileSystem &VFS);
42 // Query blacklisted entries if any bit in Mask matches the entry's section.
43 bool inSection(SanitizerMask Mask, StringRef Prefix, StringRef Query,
44 StringRef Category = StringRef()) const;
47 // Initialize SanitizerSections.
48 void createSanitizerSections();
50 struct SanitizerSection {
51 SanitizerSection(SanitizerMask SM, SectionEntries &E)
52 : Mask(SM), Entries(E){};
55 SectionEntries &Entries;
58 std::vector<SanitizerSection> SanitizerSections;
61 } // end namespace clang