diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-22 00:09:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-22 00:09:36 +0000 |
commit | dc77036a82c92fea95defed3218f1086fbd6d22d (patch) | |
tree | ee6c727de371890980899e591888015953c88ab0 /include/llvm/Analysis | |
parent | 7080c3e54ea2d56fdf7125e2700dae70161d24b5 (diff) | |
download | external_llvm-dc77036a82c92fea95defed3218f1086fbd6d22d.zip external_llvm-dc77036a82c92fea95defed3218f1086fbd6d22d.tar.gz external_llvm-dc77036a82c92fea95defed3218f1086fbd6d22d.tar.bz2 |
move this stuff out of line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20750 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSGraph.h | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/include/llvm/Analysis/DataStructure/DSGraph.h b/include/llvm/Analysis/DataStructure/DSGraph.h index d807bd0..a7ac666 100644 --- a/include/llvm/Analysis/DataStructure/DSGraph.h +++ b/include/llvm/Analysis/DataStructure/DSGraph.h @@ -118,7 +118,6 @@ public: 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 @@ public: 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 @@ public: 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); }; |