aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-10-20 21:41:02 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-10-20 21:41:02 +0000
commit26b98265b7edb493e220822e7967c0eb15d52fa6 (patch)
tree7c1d487f863f2b39b5883224dab372f3be53191c /lib/Analysis/DataStructure/BottomUpClosure.cpp
parente80fe61a72b974c423f0754990d81eb607891c46 (diff)
Remove spurious caller pointer in DSCallSite.
Also add functions to access pointer argument nodes cleanly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4235 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/BottomUpClosure.cpp')
-rw-r--r--lib/Analysis/DataStructure/BottomUpClosure.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp
index b6748d8e38..52b473883c 100644
--- a/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -60,13 +60,13 @@ static void ResolveArguments(DSCallSite &Call, Function &F,
map<Value*, DSNodeHandle> &ValueMap) {
// Resolve all of the function arguments...
Function::aiterator AI = F.abegin();
- for (unsigned i = 2, e = Call.size(); i != e; ++i) {
+ for (unsigned i = 0, e = Call.getNumPtrArgs(); i != e; ++i) {
// Advance the argument iterator to the first pointer argument...
while (!isPointerType(AI->getType())) ++AI;
// Add the link from the argument scalar to the provided value
DSNodeHandle &NN = ValueMap[AI];
- NN.addEdgeTo(Call[i]);
+ NN.addEdgeTo(Call.getPtrArgNode(i));
++AI;
}
}
@@ -111,10 +111,6 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
// Must be a function type, so this cast MUST succeed.
Function &FI = cast<Function>(*Callees[c]);
- // Record that this is a call site of FI.
- assert(&Call.getCaller() == &F && "Invalid caller in DSCallSite?");
- CallSites[&FI].push_back(Call);
-
if (&FI == &F) {
// Self recursion... simply link up the formal arguments with the
// actual arguments...
@@ -143,6 +139,11 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
DEBUG(std::cerr << "\t\t[BU] Got graph for " << FI.getName()
<< " in: " << F.getName() << "\n");
+ // Record that the original DSCallSite was a call site of FI.
+ // This may or may not have been known when the DSCallSite was
+ // originally created.
+ CallSites[&FI].push_back(Call);
+
// Clone the callee's graph into the current graph, keeping
// track of where scalars in the old graph _used_ to point,
// and of the new nodes matching nodes of the old graph.