[llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/DSGraph.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 21 16:09:49 PST 2005
Changes in directory llvm/include/llvm/Analysis/DataStructure:
DSGraph.h updated: 1.100 -> 1.101
---
Log message:
move this stuff out of line
---
Diffs of the changes: (+4 -15)
DSGraph.h | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
Index: llvm/include/llvm/Analysis/DataStructure/DSGraph.h
diff -u llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.100 llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.101
--- llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.100 Mon Mar 21 16:49:43 2005
+++ llvm/include/llvm/Analysis/DataStructure/DSGraph.h Mon Mar 21 18:09:36 2005
@@ -118,7 +118,6 @@
ValueMap.insert(std::make_pair(New, I->second));
}
-
/// operator[] - Return the DSNodeHandle for the specified value, creating a
/// new null handle if there is no entry yet.
DSNodeHandle &operator[](Value *V) {
@@ -126,20 +125,8 @@
if (I != ValueMap.end())
return I->second; // Return value if already exists.
- if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
- // If the node doesn't exist, check to see if it's a global that is
- // equated to another global in the program.
- EquivalenceClasses<GlobalValue*>::iterator ECI = GlobalECs.findValue(GV);
- if (ECI != GlobalECs.end()) {
- GlobalValue *Leader = *GlobalECs.findLeader(ECI);
- if (Leader != GV)
- return operator[]((Value*)Leader);
- }
-
- // Okay, this is either not an equivalenced global or it is the leader, it
- // will be inserted into the scalar map now.
- GlobalSet.insert(GV);
- }
+ if (GlobalValue *GV = dyn_cast<GlobalValue>(V))
+ return AddGlobal(GV);
return ValueMap.insert(std::make_pair(V, DSNodeHandle())).first->second;
}
@@ -163,6 +150,8 @@
global_iterator global_end() const { return GlobalSet.end(); }
unsigned global_size() const { return GlobalSet.size(); }
unsigned global_count(GlobalValue *GV) const { return GlobalSet.count(GV); }
+private:
+ DSNodeHandle &AddGlobal(GlobalValue *GV);
};
More information about the llvm-commits
mailing list