[PATCH] D36311: [ThinLTO] Add GraphTraits for FunctionSummaries

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 07:04:42 PDT 2017


tejohnson added a comment.

In https://reviews.llvm.org/D36311#843271, @ncharlie wrote:

> I tried implementing a search to find the root nodes in the Index callgraph. But there can be multiple root nodes in the callgraph and we can only return one node from GraphTraits<ModuleSummaryIndex *>::getEntry. Since I didn't know how to pick the correct root, I didn't go with that solution. Is there any information I can find in the Index that indicates the entry point?


Looking at how the GraphTraits is implemented for the CFG, it returns a special "ExternalCallingNode", that is created to contain edges to all functions that may be called externally (e.g. external linkage or address taken). See CallGraph::addToCallGraph() in CallGraph.cpp. Perhaps you can create such a dummy node in the index, which has edges to all the root nodes, and return that as the entry node?


https://reviews.llvm.org/D36311





More information about the llvm-commits mailing list