clang  6.0.0svn
SanitizerSpecialCaseList.h
Go to the documentation of this file.
1 //===--- SanitizerSpecialCaseList.h - SCL for sanitizers --------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // An extension of SpecialCaseList to allowing querying sections by
11 // SanitizerMask.
12 //
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
15 #define LLVM_CLANG_BASIC_SANITIZERSPECIALCASELIST_H
16 
17 #include "clang/Basic/LLVM.h"
18 #include "clang/Basic/Sanitizers.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Support/SpecialCaseList.h"
21 #include <memory>
22 
23 namespace clang {
24 
25 class SanitizerSpecialCaseList : public llvm::SpecialCaseList {
26 public:
27  static std::unique_ptr<SanitizerSpecialCaseList>
28  create(const std::vector<std::string> &Paths, std::string &Error);
29 
30  static std::unique_ptr<SanitizerSpecialCaseList>
31  createOrDie(const std::vector<std::string> &Paths);
32 
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;
36 
37 protected:
38  // Initialize SanitizerSections.
40 
42  SanitizerSection(SanitizerMask SM, SectionEntries &E)
43  : Mask(SM), Entries(E){};
44 
46  SectionEntries &Entries;
47  };
48 
49  std::vector<SanitizerSection> SanitizerSections;
50 };
51 
52 } // end namespace clang
53 
54 #endif
Defines the clang::SanitizerKind enum.
std::vector< SanitizerSection > SanitizerSections
int Category
Definition: Format.cpp:1319
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:1308
static std::unique_ptr< SanitizerSpecialCaseList > create(const std::vector< std::string > &Paths, std::string &Error)
Dataflow Directional Tag Classes.
uint64_t SanitizerMask
Definition: Sanitizers.h:24
static std::unique_ptr< SanitizerSpecialCaseList > createOrDie(const std::vector< std::string > &Paths)