1 //===--- SanitizerBlacklist.h - Blacklist 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 // User-provided blacklist used to disable/alter instrumentation done in 11 // sanitizers. 12 // 13 //===----------------------------------------------------------------------===// 14 #ifndef LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H 15 #define LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H 16 17 #include "clang/Basic/LLVM.h" 18 #include "clang/Basic/SourceLocation.h" 19 #include "clang/Basic/SourceManager.h" 20 #include "llvm/ADT/StringRef.h" 21 #include "llvm/Support/SpecialCaseList.h" 22 #include <memory> 23 24 namespace clang { 25 26 class SanitizerBlacklist { 27 std::unique_ptr<llvm::SpecialCaseList> SCL; 28 SourceManager &SM; 29 30 public: 31 SanitizerBlacklist(StringRef BlacklistPath, SourceManager &SM); 32 bool isBlacklistedGlobal(StringRef GlobalName, 33 StringRef Category = StringRef()) const; 34 bool isBlacklistedType(StringRef MangledTypeName, 35 StringRef Category = StringRef()) const; 36 bool isBlacklistedFunction(StringRef FunctionName) const; 37 bool isBlacklistedFile(StringRef FileName, 38 StringRef Category = StringRef()) const; 39 bool isBlacklistedLocation(SourceLocation Loc, 40 StringRef Category = StringRef()) const; 41 }; 42 43 } // end namespace clang 44 45 #endif 46