From 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 18 Jan 2015 16:23:48 +0000 Subject: Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102 --- lib/CodeGen/SanitizerBlacklist.cpp | 52 -------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 lib/CodeGen/SanitizerBlacklist.cpp (limited to 'lib/CodeGen/SanitizerBlacklist.cpp') diff --git a/lib/CodeGen/SanitizerBlacklist.cpp b/lib/CodeGen/SanitizerBlacklist.cpp deleted file mode 100644 index 9f1ddc8e7d7b9..0000000000000 --- a/lib/CodeGen/SanitizerBlacklist.cpp +++ /dev/null @@ -1,52 +0,0 @@ -//===--- SanitizerBlacklist.cpp - Blacklist for sanitizers ----------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// -#include "SanitizerBlacklist.h" -#include "llvm/IR/Function.h" -#include "llvm/IR/GlobalValue.h" -#include "llvm/IR/Module.h" - -using namespace clang; -using namespace CodeGen; - -static StringRef GetGlobalTypeString(const llvm::GlobalValue &G) { - // Types of GlobalVariables are always pointer types. - llvm::Type *GType = G.getType()->getElementType(); - // For now we support blacklisting struct types only. - if (llvm::StructType *SGType = dyn_cast(GType)) { - if (!SGType->isLiteral()) - return SGType->getName(); - } - return ""; -} - -bool SanitizerBlacklist::isIn(const llvm::Module &M, - const StringRef Category) const { - return SCL->inSection("src", M.getModuleIdentifier(), Category); -} - -bool SanitizerBlacklist::isIn(const llvm::Function &F) const { - return isIn(*F.getParent()) || - SCL->inSection("fun", F.getName(), ""); -} - -bool SanitizerBlacklist::isIn(const llvm::GlobalVariable &G, - const StringRef Category) const { - return isIn(*G.getParent(), Category) || - SCL->inSection("global", G.getName(), Category) || - SCL->inSection("type", GetGlobalTypeString(G), Category); -} - -bool SanitizerBlacklist::isBlacklistedType(StringRef MangledTypeName) const { - return SCL->inSection("type", MangledTypeName); -} -- cgit v1.2.3