aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-30 02:30:50 +0000
committerChris Lattner <sabre@nondot.org>2008-11-30 02:30:50 +0000
commit25f4b2b7a3f1f2bbaf954257e7834ba29a6ede7c (patch)
treef8fe9da2d1e3608115ea05e1536718c069355e50 /lib
parentf68f310386c8e1772a3e6eba01f09590678a8f96 (diff)
introduce a typedef, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60272 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/MemoryDependenceAnalysis.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index 01af42c863..25e978d3af 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -227,10 +227,10 @@ getNonLocalDependency(Instruction *QueryInst,
MemDepResult> > &Result) {
assert(getDependency(QueryInst).isNonLocal() &&
"getNonLocalDependency should only be used on insts with non-local deps!");
- DenseMap<BasicBlock*, DepResultTy>* &CacheP = NonLocalDeps[QueryInst];
- if (CacheP == 0) CacheP = new DenseMap<BasicBlock*, DepResultTy>();
+ NonLocalDepInfo *&CacheP = NonLocalDeps[QueryInst];
+ if (CacheP == 0) CacheP = new NonLocalDepInfo();
- DenseMap<BasicBlock*, DepResultTy> &Cache = *CacheP;
+ NonLocalDepInfo &Cache = *CacheP;
/// DirtyBlocks - This is the set of blocks that need to be recomputed. In
/// the cached case, this can happen due to instructions being deleted etc. In
@@ -243,8 +243,8 @@ getNonLocalDependency(Instruction *QueryInst,
// determine what is dirty, seeding our initial DirtyBlocks worklist.
// FIXME: In the "don't need to be updated" case, this is expensive, why not
// have a per-"cache" flag saying it is undirty?
- for (DenseMap<BasicBlock*, DepResultTy>::iterator I = Cache.begin(),
- E = Cache.end(); I != E; ++I)
+ for (NonLocalDepInfo::iterator I = Cache.begin(), E = Cache.end();
+ I != E; ++I)
if (I->second.getInt() == Dirty)
DirtyBlocks.push_back(I->first);
@@ -303,8 +303,7 @@ getNonLocalDependency(Instruction *QueryInst,
// Copy the result into the output set.
- for (DenseMap<BasicBlock*, DepResultTy>::iterator I = Cache.begin(),
- E = Cache.end(); I != E; ++I)
+ for (NonLocalDepInfo::iterator I = Cache.begin(), E = Cache.end(); I != E;++I)
Result.push_back(std::make_pair(I->first, ConvToResult(I->second)));
}
@@ -316,9 +315,9 @@ void MemoryDependenceAnalysis::removeInstruction(Instruction *RemInst) {
// for any cached queries.
NonLocalDepMapType::iterator NLDI = NonLocalDeps.find(RemInst);
if (NLDI != NonLocalDeps.end()) {
- DenseMap<BasicBlock*, DepResultTy> &BlockMap = *NLDI->second;
- for (DenseMap<BasicBlock*, DepResultTy>::iterator DI =
- BlockMap.begin(), DE = BlockMap.end(); DI != DE; ++DI)
+ NonLocalDepInfo &BlockMap = *NLDI->second;
+ for (NonLocalDepInfo::iterator DI = BlockMap.begin(), DE = BlockMap.end();
+ DI != DE; ++DI)
if (Instruction *Inst = DI->second.getPointer())
ReverseNonLocalDeps[Inst].erase(RemInst);
delete &BlockMap;
@@ -389,11 +388,11 @@ void MemoryDependenceAnalysis::removeInstruction(Instruction *RemInst) {
I != E; ++I) {
assert(*I != RemInst && "Already removed NonLocalDep info for RemInst");
- DenseMap<BasicBlock*, DepResultTy> &INLD = *NonLocalDeps[*I];
+ NonLocalDepInfo &INLD = *NonLocalDeps[*I];
assert(&INLD != 0 && "Reverse mapping out of date?");
- for (DenseMap<BasicBlock*, DepResultTy>::iterator
- DI = INLD.begin(), DE = INLD.end(); DI != DE; ++DI) {
+ for (NonLocalDepInfo::iterator DI = INLD.begin(), DE = INLD.end();
+ DI != DE; ++DI) {
if (DI->second.getPointer() != RemInst) continue;
// Convert to a dirty entry for the subsequent instruction.
@@ -436,9 +435,9 @@ void MemoryDependenceAnalysis::verifyRemoved(Instruction *D) const {
for (NonLocalDepMapType::const_iterator I = NonLocalDeps.begin(),
E = NonLocalDeps.end(); I != E; ++I) {
assert(I->first != D && "Inst occurs in data structures");
- DenseMap<BasicBlock*, DepResultTy> &INLD = *I->second;
- for (DenseMap<BasicBlock*, DepResultTy>::iterator II = INLD.begin(),
- EE = INLD.end(); II != EE; ++II)
+ NonLocalDepInfo &INLD = *I->second;
+ for (NonLocalDepInfo::iterator II = INLD.begin(), EE = INLD.end();
+ II != EE; ++II)
assert(II->second.getPointer() != D && "Inst occurs in data structures");
}