diff options
author | Chris Lattner <sabre@nondot.org> | 2005-04-02 19:15:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-04-02 19:15:15 +0000 |
commit | df968b8b37d93c105ced41bea5d3231ee171a24e (patch) | |
tree | 69cceff6ccbc7e825e347586feba93179024166c /include/llvm/Analysis/DataStructure/EquivClassGraphs.h | |
parent | 7332f3e05d37b5bb772bb94e607fa04ef302af0f (diff) |
Change the ActualCallees callgraph from hash_multimap<Instruction,Function>
to std::set<std::pair<Inst,Func>> to avoid duplicate entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructure/EquivClassGraphs.h')
-rw-r--r-- | include/llvm/Analysis/DataStructure/EquivClassGraphs.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/llvm/Analysis/DataStructure/EquivClassGraphs.h b/include/llvm/Analysis/DataStructure/EquivClassGraphs.h index 5b0a2206d6..d97739acbf 100644 --- a/include/llvm/Analysis/DataStructure/EquivClassGraphs.h +++ b/include/llvm/Analysis/DataStructure/EquivClassGraphs.h @@ -39,7 +39,7 @@ namespace llvm { /// ActualCallees - The actual functions callable from indirect call sites. /// - hash_multimap<Instruction*, Function*> ActualCallees; + std::set<std::pair<Instruction*, Function*> > ActualCallees; // Equivalence class where functions that can potentially be called via the // same function pointer are in the same class. @@ -96,10 +96,19 @@ namespace llvm { return *GlobalsGraph; } - typedef hash_multimap<Instruction*, Function*> ActualCalleesTy; + typedef std::set<std::pair<Instruction*, Function*> > ActualCalleesTy; const ActualCalleesTy &getActualCallees() const { return ActualCallees; } + + ActualCalleesTy::iterator callee_begin(Instruction *I) const { + return ActualCallees.lower_bound(std::pair<Instruction*,Function*>(I, 0)); + } + + ActualCalleesTy::iterator callee_end(Instruction *I) const { + I = (Instruction*)((char*)I + 1); + return ActualCallees.lower_bound(std::pair<Instruction*,Function*>(I, 0)); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); |