diff --git a/lib/Analysis/DataStructure/ComputeClosure.cpp b/lib/Analysis/DataStructure/ComputeClosure.cpp index 67309e8c77d..4327baaa80b 100644 --- a/lib/Analysis/DataStructure/ComputeClosure.cpp +++ b/lib/Analysis/DataStructure/ComputeClosure.cpp @@ -74,12 +74,16 @@ static void ResolveNodeTo(DSNode *Node, const PointerValSet &ToVals) { // node that we can inline... // static bool isResolvableCallNode(CallDSNode *CN) { - // Only operate on call nodes with direct method calls - Function *F = CN->getCall()->getCalledFunction(); - if (F == 0) return false; + // Only operate on call nodes with direct function calls + if (CN->getArgValues(0).size() == 1 && + isa(CN->getArgValues(0)[0].Node)) { + GlobalDSNode *GDN = cast(CN->getArgValues(0)[0].Node); + Function *F = cast(GDN->getGlobal()); - // Only work on call nodes with direct calls to methods with bodies. - return !F->isExternal(); + // Only work on call nodes with direct calls to methods with bodies. + return !F->isExternal(); + } + return false; } @@ -100,9 +104,8 @@ void FunctionDSGraph::computeClosure(const DataStructure &DS) { NI = std::find_if(CallNodes.begin(), CallNodes.end(), isResolvableCallNode); while (NI != CallNodes.end()) { CallDSNode *CN = *NI; - // FIXME: This should work based on the pointer val set of the first arg - // link (which is the function to call) - Function *F = CN->getCall()->getCalledFunction(); + GlobalDSNode *FGDN = cast(CN->getArgValues(0)[0].Node); + Function *F = cast(FGDN->getGlobal()); if (NumInlines++ == 100) { // CUTE hack huh? cerr << "Infinite (?) recursion halted\n"; diff --git a/lib/Analysis/DataStructure/NodeImpl.cpp b/lib/Analysis/DataStructure/NodeImpl.cpp index 4451f6e59bb..66bd8898b1c 100644 --- a/lib/Analysis/DataStructure/NodeImpl.cpp +++ b/lib/Analysis/DataStructure/NodeImpl.cpp @@ -285,7 +285,7 @@ string CallDSNode::getCaption() const { OS << "call " << CM->getName(); else OS << "call "; - OS << "|Ret: "; + OS << ": "; WriteTypeSymbolic(OS, getType(), CI->getParent()->getParent()->getParent()); return OS.str();