mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Move Blacklist.h to include/ to enable use from clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172806 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
deb318745d
commit
ae36eccdfb
@ -42,17 +42,17 @@ class BlackList {
|
|||||||
public:
|
public:
|
||||||
BlackList(const StringRef Path);
|
BlackList(const StringRef Path);
|
||||||
// Returns whether either this function or it's source file are blacklisted.
|
// Returns whether either this function or it's source file are blacklisted.
|
||||||
bool isIn(const Function &F);
|
bool isIn(const Function &F) const;
|
||||||
// Returns whether either this global or it's source file are blacklisted.
|
// Returns whether either this global or it's source file are blacklisted.
|
||||||
bool isIn(const GlobalVariable &G);
|
bool isIn(const GlobalVariable &G) const;
|
||||||
// Returns whether this module is blacklisted by filename.
|
// Returns whether this module is blacklisted by filename.
|
||||||
bool isIn(const Module &M);
|
bool isIn(const Module &M) const;
|
||||||
// Returns whether a global should be excluded from initialization checking.
|
// Returns whether a global should be excluded from initialization checking.
|
||||||
bool isInInit(const GlobalVariable &G);
|
bool isInInit(const GlobalVariable &G) const;
|
||||||
private:
|
private:
|
||||||
StringMap<Regex*> Entries;
|
StringMap<Regex*> Entries;
|
||||||
|
|
||||||
bool inSection(const StringRef Section, const StringRef Query);
|
bool inSection(const StringRef Section, const StringRef Query) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace llvm
|
} // namespace llvm
|
@ -16,7 +16,7 @@
|
|||||||
#define DEBUG_TYPE "asan"
|
#define DEBUG_TYPE "asan"
|
||||||
|
|
||||||
#include "llvm/Transforms/Instrumentation.h"
|
#include "llvm/Transforms/Instrumentation.h"
|
||||||
#include "BlackList.h"
|
#include "llvm/Transforms/Utils/BlackList.h"
|
||||||
#include "llvm/ADT/ArrayRef.h"
|
#include "llvm/ADT/ArrayRef.h"
|
||||||
#include "llvm/ADT/DenseMap.h"
|
#include "llvm/ADT/DenseMap.h"
|
||||||
#include "llvm/ADT/DepthFirstIterator.h"
|
#include "llvm/ADT/DepthFirstIterator.h"
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "BlackList.h"
|
#include "llvm/Transforms/Utils/BlackList.h"
|
||||||
|
|
||||||
#include "llvm/ADT/OwningPtr.h"
|
#include "llvm/ADT/OwningPtr.h"
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
@ -78,21 +79,21 @@ BlackList::BlackList(const StringRef Path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Iterate through each of the prefixes, and create Regexs for them.
|
// Iterate through each of the prefixes, and create Regexs for them.
|
||||||
for (StringMap<std::string>::iterator I = Regexps.begin(), E = Regexps.end();
|
for (StringMap<std::string>::const_iterator I = Regexps.begin(),
|
||||||
I != E; ++I) {
|
E = Regexps.end(); I != E; ++I) {
|
||||||
Entries[I->getKey()] = new Regex(I->getValue());
|
Entries[I->getKey()] = new Regex(I->getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlackList::isIn(const Function &F) {
|
bool BlackList::isIn(const Function &F) const {
|
||||||
return isIn(*F.getParent()) || inSection("fun", F.getName());
|
return isIn(*F.getParent()) || inSection("fun", F.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlackList::isIn(const GlobalVariable &G) {
|
bool BlackList::isIn(const GlobalVariable &G) const {
|
||||||
return isIn(*G.getParent()) || inSection("global", G.getName());
|
return isIn(*G.getParent()) || inSection("global", G.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlackList::isIn(const Module &M) {
|
bool BlackList::isIn(const Module &M) const {
|
||||||
return inSection("src", M.getModuleIdentifier());
|
return inSection("src", M.getModuleIdentifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,14 +108,14 @@ static StringRef GetGVTypeString(const GlobalVariable &G) {
|
|||||||
return "<unknown type>";
|
return "<unknown type>";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlackList::isInInit(const GlobalVariable &G) {
|
bool BlackList::isInInit(const GlobalVariable &G) const {
|
||||||
return (isIn(*G.getParent()) ||
|
return (isIn(*G.getParent()) ||
|
||||||
inSection("global-init", G.getName()) ||
|
inSection("global-init", G.getName()) ||
|
||||||
inSection("global-init-type", GetGVTypeString(G)));
|
inSection("global-init-type", GetGVTypeString(G)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlackList::inSection(const StringRef Section, const StringRef Query) {
|
bool BlackList::inSection(const StringRef Section, const StringRef Query) const {
|
||||||
StringMap<Regex*>::iterator I = Entries.find(Section);
|
StringMap<Regex*>::const_iterator I = Entries.find(Section);
|
||||||
if (I == Entries.end()) return false;
|
if (I == Entries.end()) return false;
|
||||||
|
|
||||||
Regex *FunctionRegex = I->getValue();
|
Regex *FunctionRegex = I->getValue();
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
#define DEBUG_TYPE "msan"
|
#define DEBUG_TYPE "msan"
|
||||||
|
|
||||||
#include "llvm/Transforms/Instrumentation.h"
|
#include "llvm/Transforms/Instrumentation.h"
|
||||||
#include "BlackList.h"
|
#include "llvm/Transforms/Utils/BlackList.h"
|
||||||
#include "llvm/ADT/DepthFirstIterator.h"
|
#include "llvm/ADT/DepthFirstIterator.h"
|
||||||
#include "llvm/ADT/SmallString.h"
|
#include "llvm/ADT/SmallString.h"
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#define DEBUG_TYPE "tsan"
|
#define DEBUG_TYPE "tsan"
|
||||||
|
|
||||||
#include "llvm/Transforms/Instrumentation.h"
|
#include "llvm/Transforms/Instrumentation.h"
|
||||||
#include "BlackList.h"
|
#include "llvm/Transforms/Utils/BlackList.h"
|
||||||
#include "llvm/ADT/SmallSet.h"
|
#include "llvm/ADT/SmallSet.h"
|
||||||
#include "llvm/ADT/SmallString.h"
|
#include "llvm/ADT/SmallString.h"
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user