clang  10.0.0svn
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 #ifndef LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
14 #define LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
15 
16 #include "clang/Basic/LLVM.h"
17 #include "clang/Basic/Sanitizers.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/Support/SpecialCaseList.h"
20 #include <memory>
21 
22 namespace clang {
23 
24 class SanitizerSpecialCaseList : public llvm::SpecialCaseList {
25 public:
26  static std::unique_ptr<SanitizerSpecialCaseList>
27  create(const std::vector<std::string> &Paths, std::string &Error);
28 
29  static std::unique_ptr<SanitizerSpecialCaseList>
30  createOrDie(const std::vector<std::string> &Paths);
31 
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;
35 
36 protected:
37  // Initialize SanitizerSections.
39 
41  SanitizerSection(SanitizerMask SM, SectionEntries &E)
42  : Mask(SM), Entries(E){};
43 
45  SectionEntries &Entries;
46  };
47 
48  std::vector<SanitizerSection> SanitizerSections;
49 };
50 
51 } // end namespace clang
52 
53 #endif
Defines the clang::SanitizerKind enum.
std::vector< SanitizerSection > SanitizerSections
int Category
Definition: Format.cpp:1810
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
bool inSection(SanitizerMask Mask, StringRef Prefix, StringRef Query, StringRef Category=StringRef()) const
SanitizerSection(SanitizerMask SM, SectionEntries &E)
const SourceManager & SM
Definition: Format.cpp:1667
static std::unique_ptr< SanitizerSpecialCaseList > create(const std::vector< std::string > &Paths, std::string &Error)
Dataflow Directional Tag Classes.
static std::unique_ptr< SanitizerSpecialCaseList > createOrDie(const std::vector< std::string > &Paths)