From e18b97121c286eeff5efe89150b093bf1b7b7bfc Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 9 Dec 2009 07:08:01 +0000 Subject: change NonLocalDepEntry from being a typedef for an std::pair to be its own small class. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90956 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/MemoryDependenceAnalysis.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'include/llvm/Analysis/MemoryDependenceAnalysis.h') diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index b46563b475..34a4a17e17 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -131,6 +131,27 @@ namespace llvm { } }; + /// NonLocalDepEntry - This is an entry in the NonLocalDepInfo cache, and an + /// entry in the results set for a non-local query. For each BasicBlock (the + /// BB entry) it keeps a MemDepResult. + class NonLocalDepEntry { + BasicBlock *BB; + MemDepResult Result; + public: + NonLocalDepEntry(BasicBlock *bb, MemDepResult result) + : BB(bb), Result(result) {} + + // BB is the sort key, it can't be changed. + BasicBlock *getBB() const { return BB; } + + const MemDepResult &getResult() const { return Result; } + void setResult(const MemDepResult &R) { Result = R; } + + bool operator<(const NonLocalDepEntry &RHS) const { + return BB < RHS.BB; + } + }; + /// MemoryDependenceAnalysis - This is an analysis that determines, for a /// given memory operation, what preceding memory operations it depends on. /// It builds on alias analysis information, and tries to provide a lazy, @@ -152,7 +173,6 @@ namespace llvm { LocalDepMapType LocalDeps; public: - typedef std::pair NonLocalDepEntry; typedef std::vector NonLocalDepInfo; private: /// ValueIsLoadPair - This is a pair where the bool is true if -- cgit v1.2.3