clang 20.0.0git
SanitizerSpecialCaseList.h
Go to the documentation of this file.
1//===--- SanitizerSpecialCaseList.h - SCL for sanitizers --------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// An extension of SpecialCaseList to allowing querying sections by
10// SanitizerMask.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
15#define LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
16
17#include "clang/Basic/LLVM.h"
19#include "llvm/ADT/StringRef.h"
20#include "llvm/Support/SpecialCaseList.h"
21#include <memory>
22#include <vector>
23
24namespace llvm {
25namespace vfs {
26class FileSystem;
27}
28} // namespace llvm
29
30namespace clang {
31
32class SanitizerSpecialCaseList : public llvm::SpecialCaseList {
33public:
34 static std::unique_ptr<SanitizerSpecialCaseList>
35 create(const std::vector<std::string> &Paths, llvm::vfs::FileSystem &VFS,
36 std::string &Error);
37
38 static std::unique_ptr<SanitizerSpecialCaseList>
39 createOrDie(const std::vector<std::string> &Paths,
40 llvm::vfs::FileSystem &VFS);
41
42 // Query ignorelisted 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;
45
46protected:
47 // Initialize SanitizerSections.
49
52 : Mask(SM), Entries(E){};
53
55 SectionEntries &Entries;
56 };
57
58 std::vector<SanitizerSection> SanitizerSections;
59};
60
61} // end namespace clang
62
63#endif
#define SM(sm)
Definition: Cuda.cpp:83
Expr * E
int Category
Definition: Format.cpp:3004
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SanitizerKind enum.
static std::unique_ptr< SanitizerSpecialCaseList > create(const std::vector< std::string > &Paths, llvm::vfs::FileSystem &VFS, std::string &Error)
bool inSection(SanitizerMask Mask, StringRef Prefix, StringRef Query, StringRef Category=StringRef()) const
static std::unique_ptr< SanitizerSpecialCaseList > createOrDie(const std::vector< std::string > &Paths, llvm::vfs::FileSystem &VFS)
std::vector< SanitizerSection > SanitizerSections
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30
SanitizerSection(SanitizerMask SM, SectionEntries &E)