clang 10.0.0git

SanitizerBlacklist.h
Go to the documentation of this file.
1 //===--- SanitizerBlacklist.h - Blacklist 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 // User-provided blacklist used to disable/alter instrumentation done in
10 // sanitizers.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H
14 #define LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H
15
16 #include "clang/Basic/LLVM.h"
17 #include "clang/Basic/SanitizerSpecialCaseList.h"
18 #include "clang/Basic/Sanitizers.h"
19 #include "clang/Basic/SourceLocation.h"
20 #include "clang/Basic/SourceManager.h"
21 #include "llvm/ADT/StringRef.h"
22 #include <memory>
23
24 namespace clang {
25
26 class SanitizerBlacklist {
27 std::unique_ptr<SanitizerSpecialCaseList> SSCL;
28 SourceManager &SM;
29
30 public:
31 SanitizerBlacklist(const std::vector<std::string> &BlacklistPaths,
32 SourceManager &SM);
33 bool isBlacklistedGlobal(SanitizerMask Mask, StringRef GlobalName,
34 StringRef Category = StringRef()) const;
35 bool isBlacklistedType(SanitizerMask Mask, StringRef MangledTypeName,
36 StringRef Category = StringRef()) const;
37 bool isBlacklistedFunction(SanitizerMask Mask, StringRef FunctionName) const;
38 bool isBlacklistedFile(SanitizerMask Mask, StringRef FileName,
39 StringRef Category = StringRef()) const;
40 bool isBlacklistedLocation(SanitizerMask Mask, SourceLocation Loc,
41 StringRef Category = StringRef()) const;
42 };
43
44 } // end namespace clang
45
46 #endif
SanitizerSpecialCaseList.h
clang::SanitizerBlacklist::isBlacklistedType
bool isBlacklistedType(SanitizerMask Mask, StringRef MangledTypeName, StringRef Category=StringRef()) const
Definition: SanitizerBlacklist.cpp:29
SourceManager.h
Defines the SourceManager interface.
clang::SanitizerBlacklist::isBlacklistedLocation
bool isBlacklistedLocation(SanitizerMask Mask, SourceLocation Loc, StringRef Category=StringRef()) const
Definition: SanitizerBlacklist.cpp:46
Sanitizers.h
Defines the clang::SanitizerKind enum.
Category
int Category
Definition: Format.cpp:1828
LLVM.h
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
clang::SanitizerBlacklist::isBlacklistedFile
bool isBlacklistedFile(SanitizerMask Mask, StringRef FileName, StringRef Category=StringRef()) const
Definition: SanitizerBlacklist.cpp:40
clang::SanitizerBlacklist::isBlacklistedFunction
bool isBlacklistedFunction(SanitizerMask Mask, StringRef FunctionName) const
Definition: SanitizerBlacklist.cpp:35
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::SanitizerMask
Definition: Sanitizers.h:29
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::SanitizerBlacklist::isBlacklistedGlobal
bool isBlacklistedGlobal(SanitizerMask Mask, StringRef GlobalName, StringRef Category=StringRef()) const
Definition: SanitizerBlacklist.cpp:23
clang::SanitizerBlacklist
Definition: SanitizerBlacklist.h:26
SourceLocation.h
Defines the clang::SourceLocation class and associated facilities.
clang::SanitizerBlacklist::SanitizerBlacklist
SanitizerBlacklist(const std::vector< std::string > &BlacklistPaths, SourceManager &SM)
Definition: SanitizerBlacklist.cpp:17
clang::SourceManager
This class handles loading and caching of source files into memory.
Definition: SourceManager.h:596