summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/SanitizerBlacklist.h
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-10-15 19:57:45 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-10-15 19:57:45 +0000
commit8bb2e13a15197d424c3436c1fb83df155a1fc538 (patch)
treef834f0b62fc32c308191a9f79d01e3388ff0becc /include/clang/Basic/SanitizerBlacklist.h
parente0dc8e2329b068fe3476cd1297239a9f098e9f12 (diff)
Move SanitizerBlacklist to clangBasic. NFC.
This change moves SanitizerBlacklist.h from lib/CodeGen to public Clang headers in include/clang/Basic. SanitizerBlacklist is currently only used in CodeGen to decide which functions/modules should be instrumented, but this will soon change as ASan will optionally modify class layouts during AST construction (http://reviews.llvm.org/D5687). We need blacklist machinery to be available at this point. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SanitizerBlacklist.h')
-rw-r--r--include/clang/Basic/SanitizerBlacklist.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/clang/Basic/SanitizerBlacklist.h b/include/clang/Basic/SanitizerBlacklist.h
new file mode 100644
index 0000000000..82d88f6bd0
--- /dev/null
+++ b/include/clang/Basic/SanitizerBlacklist.h
@@ -0,0 +1,46 @@
+//===--- SanitizerBlacklist.h - Blacklist for sanitizers --------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// User-provided blacklist used to disable/alter instrumentation done in
+// sanitizers.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H
+#define LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H
+
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/SpecialCaseList.h"
+#include <memory>
+
+namespace llvm {
+class GlobalVariable;
+class Function;
+class Module;
+}
+
+namespace clang {
+
+class SanitizerBlacklist {
+ std::unique_ptr<llvm::SpecialCaseList> SCL;
+
+public:
+ SanitizerBlacklist(std::unique_ptr<llvm::SpecialCaseList> SCL)
+ : SCL(std::move(SCL)) {}
+ bool isIn(const llvm::Module &M,
+ StringRef Category = StringRef()) const;
+ bool isIn(const llvm::Function &F) const;
+ bool isIn(const llvm::GlobalVariable &G,
+ StringRef Category = StringRef()) const;
+ bool isBlacklistedType(StringRef MangledTypeName) const;
+};
+
+} // end namespace clang
+
+#endif