diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-21 04:46:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-21 04:46:35 +0000 |
commit | 7757b9fe9f28fba46345069272046958460ffaa3 (patch) | |
tree | 2d391e23ac13e7b1d4089fec6ed6ca9ba032dea8 /include/llvm/Analysis/DataStructure/DataStructure.h | |
parent | 24a751eccda668e15cca2a84772d504b47c40378 (diff) |
rename a method add a data structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructure/DataStructure.h')
-rw-r--r-- | include/llvm/Analysis/DataStructure/DataStructure.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h index 215c4a5409..15ae2dc945 100644 --- a/include/llvm/Analysis/DataStructure/DataStructure.h +++ b/include/llvm/Analysis/DataStructure/DataStructure.h @@ -26,6 +26,7 @@ class Type; class Instruction; class GlobalValue; class DSGraph; +class DSCallSite; class DSNode; class DSNodeHandle; @@ -181,6 +182,25 @@ class TDDataStructures : public ModulePass { /// GlobalECs - The equivalence classes for each global value that is merged /// with other global values in the DSGraphs. EquivalenceClasses<GlobalValue*> GlobalECs; + + /// CallerCallEdges - For a particular graph, we keep a list of these records + /// which indicates which graphs call this function and from where. + struct CallerCallEdge { + DSGraph *CallerGraph; // The graph of the caller function. + const DSCallSite *CS; // The actual call site. + Function *CalledFunction; // The actual function being called. + + CallerCallEdge(DSGraph *G, const DSCallSite *cs, Function *CF) + : CallerGraph(G), CS(cs), CalledFunction(CF) {} + + bool operator<(const CallerCallEdge &RHS) const { + return CallerGraph < RHS.CallerGraph || + (CallerGraph == RHS.CallerGraph && CS < RHS.CS); + } + }; + + std::map<DSGraph*, std::vector<CallerCallEdge> > CallerEdges; + public: ~TDDataStructures() { releaseMyMemory(); } @@ -227,7 +247,7 @@ private: void markReachableFunctionsExternallyAccessible(DSNode *N, hash_set<DSNode*> &Visited); - void inlineGraphIntoCallees(DSGraph &G); + void InlineCallersIntoGraph(DSGraph &G); DSGraph &getOrCreateDSGraph(Function &F); void ComputePostOrder(Function &F, hash_set<DSGraph*> &Visited, std::vector<DSGraph*> &PostOrder, |