aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-07-09 22:03:09 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-07-09 22:03:09 +0000
commitc5afb9ed5eb9aeb3eff5158e15844705e8a9ee2d (patch)
tree2ad39d3ae33f0ad65d0d88b152fe9f1dedc04572 /include/llvm/Transforms
parent405515d55f470d04ef75f653b7f1994329c9066b (diff)
downloadexternal_llvm-c5afb9ed5eb9aeb3eff5158e15844705e8a9ee2d.zip
external_llvm-c5afb9ed5eb9aeb3eff5158e15844705e8a9ee2d.tar.gz
external_llvm-c5afb9ed5eb9aeb3eff5158e15844705e8a9ee2d.tar.bz2
Introduce a SpecialCaseList ctor which takes a MemoryBuffer to make
it more unit testable, and fix memory leak in the other ctor. Differential Revision: http://llvm-reviews.chandlerc.com/D1090 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r--include/llvm/Transforms/Utils/SpecialCaseList.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/SpecialCaseList.h b/include/llvm/Transforms/Utils/SpecialCaseList.h
index 42d9735..30e3e46 100644
--- a/include/llvm/Transforms/Utils/SpecialCaseList.h
+++ b/include/llvm/Transforms/Utils/SpecialCaseList.h
@@ -35,6 +35,7 @@
namespace llvm {
class Function;
class GlobalVariable;
+class MemoryBuffer;
class Module;
class Regex;
class StringRef;
@@ -42,6 +43,8 @@ class StringRef;
class SpecialCaseList {
public:
SpecialCaseList(const StringRef Path);
+ SpecialCaseList(const MemoryBuffer *MB);
+
// Returns whether either this function or it's source file are blacklisted.
bool isIn(const Function &F) const;
// Returns whether either this global or it's source file are blacklisted.
@@ -53,6 +56,7 @@ class SpecialCaseList {
private:
StringMap<Regex*> Entries;
+ void init(const MemoryBuffer *MB);
bool inSection(const StringRef Section, const StringRef Query) const;
};