[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Mar 9 13:38:09 PST 2004
Changes in directory llvm/lib/Analysis/DataStructure:
DataStructure.cpp updated: 1.170 -> 1.171
---
Log message:
implement new method
---
Diffs of the changes: (+24 -0)
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.170 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.171
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.170 Sun Mar 7 21:52:24 2004
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Mar 9 13:37:06 2004
@@ -1375,6 +1375,30 @@
return DSCallSite(CallSite(), getReturnNodeFor(F), &F, Args);
}
+/// getDSCallSiteForCallSite - Given an LLVM CallSite object that is live in
+/// the context of this graph, return the DSCallSite for it.
+DSCallSite DSGraph::getDSCallSiteForCallSite(CallSite CS) const {
+ DSNodeHandle RetVal;
+ Instruction *I = CS.getInstruction();
+ if (isPointerType(I->getType()))
+ RetVal = getNodeForValue(I);
+
+ std::vector<DSNodeHandle> Args;
+ Args.reserve(CS.arg_end()-CS.arg_begin());
+
+ // Calculate the arguments vector...
+ for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I)
+ if (isPointerType((*I)->getType()))
+ Args.push_back(getNodeForValue(*I));
+
+ // Add a new function call entry...
+ if (Function *F = CS.getCalledFunction())
+ return DSCallSite(CS, RetVal, F, Args);
+ else
+ return DSCallSite(CS, RetVal,
+ getNodeForValue(CS.getCalledValue()).getNode(), Args);
+}
+
// markIncompleteNodes - Mark the specified node as having contents that are not
More information about the llvm-commits
mailing list