diff options
author | Chris Lattner <sabre@nondot.org> | 2003-07-01 16:27:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-07-01 16:27:15 +0000 |
commit | 17d5d863b2a84b63beb3f49d11300cbaf0cb6821 (patch) | |
tree | 639bb121eef14e11ac9e389adece2f22aa6373c3 /include | |
parent | 5d5b6d6a5c93242f8105d1b3e273d5d0b47e4744 (diff) | |
download | llvm-17d5d863b2a84b63beb3f49d11300cbaf0cb6821.tar.gz llvm-17d5d863b2a84b63beb3f49d11300cbaf0cb6821.tar.bz2 llvm-17d5d863b2a84b63beb3f49d11300cbaf0cb6821.tar.xz |
Add new methods to BUDS for keeping track of a precise call graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/DataStructure.h | 25 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DataStructure.h | 25 |
2 files changed, 26 insertions, 24 deletions
diff --git a/include/llvm/Analysis/DataStructure.h b/include/llvm/Analysis/DataStructure.h index 354728f5a6..6dddf24ef6 100644 --- a/include/llvm/Analysis/DataStructure.h +++ b/include/llvm/Analysis/DataStructure.h @@ -12,6 +12,7 @@ #include "Support/hash_set" class Type; +class CallInst; class DSGraph; class DSNode; class DSCallSite; @@ -75,6 +76,7 @@ class BUDataStructures : public Pass { // DSInfo, one graph for each function hash_map<Function*, DSGraph*> DSInfo; DSGraph *GlobalsGraph; + hash_multimap<CallInst*, Function*> ActualCallees; public: ~BUDataStructures() { releaseMemory(); } @@ -104,19 +106,15 @@ public: AU.setPreservesAll(); AU.addRequired<LocalDataStructures>(); } + + typedef hash_multimap<CallInst*, Function*> ActualCalleesTy; + const ActualCalleesTy &getActualCallees() const { + return ActualCallees; + } + private: void calculateGraph(DSGraph &G); - // inlineNonSCCGraphs - This method is almost like the other two calculate - // graph methods. This one is used to inline function graphs (from functions - // outside of the SCC) into functions in the SCC. It is not supposed to touch - // functions IN the SCC at all. - // - DSGraph &inlineNonSCCGraphs(Function &F, - hash_set<Function*> &SCCFunctions); - - DSGraph &calculateSCCGraph(Function &F, - hash_set<Function*> &InlinedSCCFunctions); void calculateReachableGraphs(Function *F); @@ -135,7 +133,6 @@ private: class TDDataStructures : public Pass { // DSInfo, one graph for each function hash_map<Function*, DSGraph*> DSInfo; - hash_set<const Function*> GraphDone; DSGraph *GlobalsGraph; public: ~TDDataStructures() { releaseMyMemory(); } @@ -169,8 +166,12 @@ public: } private: - void calculateGraph(Function &F); + void calculateGraphFrom(Function &F); + void inlineGraphIntoCallees(DSGraph &G); DSGraph &getOrCreateDSGraph(Function &F); + void ComputePostOrder(Function &F, hash_set<DSGraph*> &Visited, + std::vector<DSGraph*> &PostOrder, + const BUDataStructures::ActualCalleesTy &ActualCallees); }; #endif diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h index 354728f5a6..6dddf24ef6 100644 --- a/include/llvm/Analysis/DataStructure/DataStructure.h +++ b/include/llvm/Analysis/DataStructure/DataStructure.h @@ -12,6 +12,7 @@ #include "Support/hash_set" class Type; +class CallInst; class DSGraph; class DSNode; class DSCallSite; @@ -75,6 +76,7 @@ class BUDataStructures : public Pass { // DSInfo, one graph for each function hash_map<Function*, DSGraph*> DSInfo; DSGraph *GlobalsGraph; + hash_multimap<CallInst*, Function*> ActualCallees; public: ~BUDataStructures() { releaseMemory(); } @@ -104,19 +106,15 @@ public: AU.setPreservesAll(); AU.addRequired<LocalDataStructures>(); } + + typedef hash_multimap<CallInst*, Function*> ActualCalleesTy; + const ActualCalleesTy &getActualCallees() const { + return ActualCallees; + } + private: void calculateGraph(DSGraph &G); - // inlineNonSCCGraphs - This method is almost like the other two calculate - // graph methods. This one is used to inline function graphs (from functions - // outside of the SCC) into functions in the SCC. It is not supposed to touch - // functions IN the SCC at all. - // - DSGraph &inlineNonSCCGraphs(Function &F, - hash_set<Function*> &SCCFunctions); - - DSGraph &calculateSCCGraph(Function &F, - hash_set<Function*> &InlinedSCCFunctions); void calculateReachableGraphs(Function *F); @@ -135,7 +133,6 @@ private: class TDDataStructures : public Pass { // DSInfo, one graph for each function hash_map<Function*, DSGraph*> DSInfo; - hash_set<const Function*> GraphDone; DSGraph *GlobalsGraph; public: ~TDDataStructures() { releaseMyMemory(); } @@ -169,8 +166,12 @@ public: } private: - void calculateGraph(Function &F); + void calculateGraphFrom(Function &F); + void inlineGraphIntoCallees(DSGraph &G); DSGraph &getOrCreateDSGraph(Function &F); + void ComputePostOrder(Function &F, hash_set<DSGraph*> &Visited, + std::vector<DSGraph*> &PostOrder, + const BUDataStructures::ActualCalleesTy &ActualCallees); }; #endif |