Home | History | Annotate | Download | only in Basic
      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(const std::vector<std::string> &BlacklistPaths,
     32                      SourceManager &SM);
     33   bool isBlacklistedGlobal(StringRef GlobalName,
     34                            StringRef Category = StringRef()) const;
     35   bool isBlacklistedType(StringRef MangledTypeName,
     36                          StringRef Category = StringRef()) const;
     37   bool isBlacklistedFunction(StringRef FunctionName) const;
     38   bool isBlacklistedFile(StringRef FileName,
     39                          StringRef Category = StringRef()) const;
     40   bool isBlacklistedLocation(SourceLocation Loc,
     41                              StringRef Category = StringRef()) const;
     42 };
     43 
     44 }  // end namespace clang
     45 
     46 #endif
     47