clang  14.0.0git
NoSanitizeList.h
Go to the documentation of this file.
1 //===--- NoSanitizeList.h - List of ignored entities for sanitizers --*- C++
2 //-*-===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // User-provided list of ignored entities used to disable/alter
11 // instrumentation done in sanitizers.
12 //
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_BASIC_NOSANITIZELIST_H
15 #define LLVM_CLANG_BASIC_NOSANITIZELIST_H
16 
17 #include "clang/Basic/LLVM.h"
19 #include "llvm/ADT/StringRef.h"
20 #include <memory>
21 #include <vector>
22 
23 namespace clang {
24 
25 class SanitizerMask;
26 class SourceManager;
27 class SanitizerSpecialCaseList;
28 
30  std::unique_ptr<SanitizerSpecialCaseList> SSCL;
31  SourceManager &SM;
32 
33 public:
34  NoSanitizeList(const std::vector<std::string> &NoSanitizeListPaths,
35  SourceManager &SM);
37  bool containsGlobal(SanitizerMask Mask, StringRef GlobalName,
38  StringRef Category = StringRef()) const;
39  bool containsType(SanitizerMask Mask, StringRef MangledTypeName,
40  StringRef Category = StringRef()) const;
41  bool containsFunction(SanitizerMask Mask, StringRef FunctionName) const;
42  bool containsFile(SanitizerMask Mask, StringRef FileName,
43  StringRef Category = StringRef()) const;
45  StringRef Category = StringRef()) const;
46 };
47 
48 } // end namespace clang
49 
50 #endif
clang::NoSanitizeList::~NoSanitizeList
~NoSanitizeList()
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:88
clang::NoSanitizeList
Definition: NoSanitizeList.h:29
clang::SourceManager
This class handles loading and caching of source files into memory.
Definition: SourceManager.h:626
clang::NoSanitizeList::containsFunction
bool containsFunction(SanitizerMask Mask, StringRef FunctionName) const
Definition: NoSanitizeList.cpp:40
clang::NoSanitizeList::NoSanitizeList
NoSanitizeList(const std::vector< std::string > &NoSanitizeListPaths, SourceManager &SM)
Definition: NoSanitizeList.cpp:22
Category
int Category
Definition: Format.cpp:2336
SourceLocation.h
LLVM.h
clang::NoSanitizeList::containsGlobal
bool containsGlobal(SanitizerMask Mask, StringRef GlobalName, StringRef Category=StringRef()) const
Definition: NoSanitizeList.cpp:30
clang::NoSanitizeList::containsFile
bool containsFile(SanitizerMask Mask, StringRef FileName, StringRef Category=StringRef()) const
Definition: NoSanitizeList.cpp:45
clang
Definition: CalledOnceCheck.h:17
clang::NoSanitizeList::containsLocation
bool containsLocation(SanitizerMask Mask, SourceLocation Loc, StringRef Category=StringRef()) const
Definition: NoSanitizeList.cpp:50
clang::NoSanitizeList::containsType
bool containsType(SanitizerMask Mask, StringRef MangledTypeName, StringRef Category=StringRef()) const
Definition: NoSanitizeList.cpp:35
SM
#define SM(sm)
Definition: Cuda.cpp:78
clang::SanitizerMask
Definition: Sanitizers.h:30