// function or we cannot determine the complete set of functions invoked).
//
DSGraph* FunctionModRefInfo::ResolveCallSiteModRefInfo(CallInst &CI,
- std::map<const DSNode*, DSNodeHandle> &NodeMap)
+ hash_map<const DSNode*, DSNodeHandle> &NodeMap)
{
// Step #0: Quick check if we are going to fail anyway: avoid
// all the graph cloning and map copying in steps #1 and #2.
Result->maskNodeTypes(~(DSNode::Modified | DSNode::Read));
// Step #3: clone the bottom up graphs for the callees into the caller graph
- if (const Function *F = CI.getCalledFunction())
+ if (Function *F = CI.getCalledFunction())
{
assert(!F->isExternal());
Args.push_back(Result->getNodeForValue(CI.getOperand(i)));
// Build the call site...
- DSCallSite CS(CI, RetVal, 0, Args);
+ DSCallSite CS(CI, RetVal, F, Args);
// Perform the merging now of the graph for the callee, which will
// come with mod/ref bits set...
assert(0 && "See error message");
// Remove dead nodes aggressively to match the caller's original graph.
- Result->removeDeadNodes();
+ Result->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
// Step #4: Return the clone + the mapping (by ref)
return Result;
callSiteModRefInfo[&callInst] = callModRefInfo;
// Get a copy of the graph for the callee with the callee inlined
- std::map<const DSNode*, DSNodeHandle> NodeMap;
+ hash_map<const DSNode*, DSNodeHandle> NodeMap;
DSGraph* csgp = ResolveCallSiteModRefInfo(const_cast<CallInst&>(callInst),
NodeMap);
if (!csgp)
knownValues.resize(tdGraph.getGraphSize());
// For every identifiable value, save Value pointer in knownValues[i]
- for (std::map<Value*, DSNodeHandle>::const_iterator
+ for (hash_map<Value*, DSNodeHandle>::const_iterator
I = tdGraph.getScalarMap().begin(),
E = tdGraph.getScalarMap().end(); I != E; ++I)
if (isa<GlobalValue>(I->first) ||
// The memory for this graph clone will be freed by FunctionModRefInfo.
DSGraph* funcTDGraph =
new DSGraph(getAnalysis<TDDataStructures>().getDSGraph(func));
- funcTDGraph->removeDeadNodes();
+ funcTDGraph->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
funcInfo = new FunctionModRefInfo(func, *this, funcTDGraph); //auto-insert
funcInfo->computeModRef(func); // computes the mod/ref info