clang API Documentation

SanitizerBlacklist.h
Go to the documentation of this file.
00001 //===--- SanitizerBlacklist.h - Blacklist for sanitizers --------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // User-provided blacklist used to disable/alter instrumentation done in
00011 // sanitizers.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 #ifndef LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H
00015 #define LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H
00016 
00017 #include "clang/Basic/LLVM.h"
00018 #include "clang/Basic/SourceLocation.h"
00019 #include "clang/Basic/SourceManager.h"
00020 #include "llvm/ADT/StringRef.h"
00021 #include "llvm/Support/SpecialCaseList.h"
00022 #include <memory>
00023 
00024 namespace clang {
00025 
00026 class SanitizerBlacklist {
00027   std::unique_ptr<llvm::SpecialCaseList> SCL;
00028   SourceManager &SM;
00029 
00030 public:
00031   SanitizerBlacklist(StringRef BlacklistPath, SourceManager &SM);
00032   bool isBlacklistedGlobal(StringRef GlobalName,
00033                            StringRef Category = StringRef()) const;
00034   bool isBlacklistedType(StringRef MangledTypeName,
00035                          StringRef Category = StringRef()) const;
00036   bool isBlacklistedFunction(StringRef FunctionName) const;
00037   bool isBlacklistedFile(StringRef FileName,
00038                          StringRef Category = StringRef()) const;
00039   bool isBlacklistedLocation(SourceLocation Loc,
00040                              StringRef Category = StringRef()) const;
00041 };
00042 
00043 }  // end namespace clang
00044 
00045 #endif