diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-08 21:24:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-08 21:24:51 +0000 |
commit | fb39933b75218d1763f1c4d84726aa8bd0dab6db (patch) | |
tree | c10cf78daace83ee20eda0d69761bd239861e516 /include/llvm/Analysis/DataStructure/DataStructure.h | |
parent | 93fbd733e778c2623436ed5a0b9cf7f394407b1a (diff) |
- Add support for an "auxillary" call site list
- Original call sites are now never modified after construction by the local
pass.
- DSGraph::cloneInto can now optionally not clone the call sites
- BUDataStructures no longer has a ton of book-keeping info for a broken
implementation of the TD data structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructure/DataStructure.h')
-rw-r--r-- | include/llvm/Analysis/DataStructure/DataStructure.h | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h index 79d738b5e1..b38431b355 100644 --- a/include/llvm/Analysis/DataStructure/DataStructure.h +++ b/include/llvm/Analysis/DataStructure/DataStructure.h @@ -9,6 +9,7 @@ #include "llvm/Analysis/DSSupport.h" #include "llvm/Pass.h" +#include <set> class Type; class DSGraph; @@ -66,7 +67,6 @@ public: class BUDataStructures : public Pass { // DSInfo, one graph for each function std::map<const Function*, DSGraph*> DSInfo; - std::map<const Function*, std::vector<DSCallSite> > CallSites; public: ~BUDataStructures() { releaseMemory(); } @@ -79,21 +79,12 @@ public: return *I->second; } - /// getCallSites - Return all of the call sites for the specified function - /// - const std::vector<DSCallSite> *getCallSites(const Function &F) const { - std::map<const Function*, std::vector<DSCallSite> >::const_iterator I - = CallSites.find(&F); - return I != CallSites.end() ? &I->second : 0; - } - - // print - Print out the analysis results... + // print - Print out the analysis results... void print(std::ostream &O, const Module *M) const; // If the pass pipeline is done with this pass, we can release our memory... virtual void releaseMemory(); - // getAnalysisUsage - This obviously provides a data structure graph. virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired<LocalDataStructures>(); @@ -109,24 +100,7 @@ private: class TDDataStructures : public Pass { // DSInfo, one graph for each function std::map<const Function*, DSGraph*> DSInfo; - - // Each graph in DSInfo is based on a graph in the BUDS object. The BUMaps - // member keeps the mappings from the BU graphs to the TD graphs as they are - // calculated by calculateGraph. This information is used to properly - // implement resolving of call sites, where the call sites in the BUGraph are - // in terms of the caller function's graph in the BUGraph. - // - typedef std::map<const DSNode*, DSNodeHandle> BUNodeMapTy; - std::map<const Function*, BUNodeMapTy> BUMaps; - - // CallSitesForFunction - This is a temporary map that is only kept around - // when building the top-down closures for a program. It traverses all of the - // call sites in the BU graph and holds all of the call sites that each - // function is the "resolving caller" for. - // - std::map<const Function*, - std::vector<const DSCallSite*> > CallSitesForFunction; - + std::set<const Function*> GraphDone; public: ~TDDataStructures() { releaseMemory(); } @@ -151,7 +125,8 @@ public: AU.addRequired<BUDataStructures>(); } private: - DSGraph &calculateGraph(Function &F); + void calculateGraph(Function &F); + DSGraph &getOrCreateDSGraph(Function &F); void ResolveCallSite(DSGraph &Graph, const DSCallSite &CallSite); }; |