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/SanitizerSpecialCaseList.h"
     19 #include "clang/Basic/Sanitizers.h"
     20 #include "clang/Basic/SourceLocation.h"
     21 #include "clang/Basic/SourceManager.h"
     22 #include "llvm/ADT/StringRef.h"
     23 #include <memory>
     24 
     25 namespace clang {
     26 
     27 class SanitizerBlacklist {
     28   std::unique_ptr<SanitizerSpecialCaseList> SSCL;
     29   SourceManager &SM;
     30 
     31 public:
     32   SanitizerBlacklist(const std::vector<std::string> &BlacklistPaths,
     33                      SourceManager &SM);
     34   bool isBlacklistedGlobal(SanitizerMask Mask, StringRef GlobalName,
     35                            StringRef Category = StringRef()) const;
     36   bool isBlacklistedType(SanitizerMask Mask, StringRef MangledTypeName,
     37                          StringRef Category = StringRef()) const;
     38   bool isBlacklistedFunction(SanitizerMask Mask, StringRef FunctionName) const;
     39   bool isBlacklistedFile(SanitizerMask Mask, StringRef FileName,
     40                          StringRef Category = StringRef()) const;
     41   bool isBlacklistedLocation(SanitizerMask Mask, SourceLocation Loc,
     42                              StringRef Category = StringRef()) const;
     43 };
     44 
     45 }  // end namespace clang
     46 
     47 #endif
     48