From 0c770cd936623d12891c71b9421f2c4ead072c11 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 1 Jul 2003 16:27:15 +0000 Subject: [PATCH] Add new methods to BUDS for keeping track of a precise call graph llvm-svn: 7028 --- llvm/include/llvm/Analysis/DataStructure.h | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/llvm/include/llvm/Analysis/DataStructure.h b/llvm/include/llvm/Analysis/DataStructure.h index 354728f5a65d..6dddf24ef640 100644 --- a/llvm/include/llvm/Analysis/DataStructure.h +++ b/llvm/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 DSInfo; DSGraph *GlobalsGraph; + hash_multimap ActualCallees; public: ~BUDataStructures() { releaseMemory(); } @@ -104,19 +106,15 @@ public: AU.setPreservesAll(); AU.addRequired(); } + + typedef hash_multimap 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 &SCCFunctions); - - DSGraph &calculateSCCGraph(Function &F, - hash_set &InlinedSCCFunctions); void calculateReachableGraphs(Function *F); @@ -135,7 +133,6 @@ private: class TDDataStructures : public Pass { // DSInfo, one graph for each function hash_map DSInfo; - hash_set 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 &Visited, + std::vector &PostOrder, + const BUDataStructures::ActualCalleesTy &ActualCallees); }; #endif