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 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
14 #define LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
16 #include "clang/Basic/LLVM.h"
17 #include "clang/Basic/Sanitizers.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/Support/SpecialCaseList.h"
24 class SanitizerSpecialCaseList : public llvm::SpecialCaseList {
26 static std::unique_ptr<SanitizerSpecialCaseList>
27 create(const std::vector<std::string> &Paths, std::string &Error);
29 static std::unique_ptr<SanitizerSpecialCaseList>
30 createOrDie(const std::vector<std::string> &Paths);
32 // Query blacklisted entries if any bit in Mask matches the entry's section.
33 bool inSection(SanitizerMask Mask, StringRef Prefix, StringRef Query,
34 StringRef Category = StringRef()) const;
37 // Initialize SanitizerSections.
38 void createSanitizerSections();
40 struct SanitizerSection {
41 SanitizerSection(SanitizerMask SM, SectionEntries &E)
42 : Mask(SM), Entries(E){};
45 SectionEntries &Entries;
48 std::vector<SanitizerSection> SanitizerSections;
51 } // end namespace clang