//===----------------------------------------------------------------------===// // CallGraph Class Enhancements //===----------------------------------------------------------------------===// 8/18/2004 The problem is that the current implementation of the CallGraph class is about as stupid as it gets. It currently assumes that all indirect call sites call call any address taken function. More agressive analysis could obviously do better than this, and we want all of our CallGraphSCC passes to be able to take advantage of this extra precision. On the other hand, we don't want to force the clients to use a particular implementation of this, as there is no globally "right" implementation that makes sense in all circumstances. //===----------------------------------------------------------------------===// // The solution // The solution to this is to just perform some minor surgery on the CallGraph class, splitting it into an analysis interface (like AliasAnalysis) and a default implementation. Unlike the alias analysis class, the actual representation of the call graph is common across all implementations of the call graph class (e.g. the use of CallGraphNode), so no accessors need to be virtual or anything like that. Implementing the CallGraph class as an analysis interface would allow other implementations (e.g. a DSA based one) to be trivially plugged in, and all clients of the CallGraph would automatically use the result.