From: Chris Lattner Date: Mon, 21 Mar 2005 04:46:35 +0000 (+0000) Subject: rename a method add a data structure. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7757b9fe9f28fba46345069272046958460ffaa3;p=oota-llvm.git rename a method add a data structure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20722 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h index 215c4a5409d..15ae2dc9452 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 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 > CallerEdges; + public: ~TDDataStructures() { releaseMyMemory(); } @@ -227,7 +247,7 @@ private: void markReachableFunctionsExternallyAccessible(DSNode *N, hash_set &Visited); - void inlineGraphIntoCallees(DSGraph &G); + void InlineCallersIntoGraph(DSGraph &G); DSGraph &getOrCreateDSGraph(Function &F); void ComputePostOrder(Function &F, hash_set &Visited, std::vector &PostOrder,