summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/Steensgaard.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-10-20 18:07:37 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-10-20 18:07:37 +0000
commitdc9e1426863c5c0efc45852742b656f319277b05 (patch)
treef70e2ba1156edd44d550b32227c4bbc6f41f7406 /llvm/lib/Analysis/DataStructure/Steensgaard.cpp
parent2b68f2fbbcd1fa383184fc86b9c5f1f8792fc192 (diff)
downloadbcm5719-llvm-dc9e1426863c5c0efc45852742b656f319277b05.tar.gz
bcm5719-llvm-dc9e1426863c5c0efc45852742b656f319277b05.zip
Added a first-class representation for each call site that can be
used in the DS graphs. Essentially, what was vector<DSNodeHandle> before is now a DSCallSite with the same vector, plus pointers to the CallInst and the caller Function. The special-purpose class BUDataStructure::CallSite is no longer needed. llvm-svn: 4228
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Steensgaard.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/Steensgaard.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp
index 2cd723772a0..9bc3db79e73 100644
--- a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp
+++ b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp
@@ -63,7 +63,7 @@ namespace {
}
private:
- void ResolveFunctionCall(Function *F, const std::vector<DSNodeHandle> &Call,
+ void ResolveFunctionCall(Function *F, const DSCallSite &Call,
DSNodeHandle &RetVal);
};
@@ -81,14 +81,14 @@ namespace {
/// and the return value for the call site context-insensitively.
///
void Steens::ResolveFunctionCall(Function *F,
- const std::vector<DSNodeHandle> &Call,
+ const DSCallSite &Call,
DSNodeHandle &RetVal) {
assert(ResultGraph != 0 && "Result graph not allocated!");
std::map<Value*, DSNodeHandle> &ValMap = ResultGraph->getValueMap();
- // Handle the return value of the function... which is Call[0]
- if (Call[0].getNode() && RetVal.getNode())
- RetVal.mergeWith(Call[0]);
+ // Handle the return value of the function...
+ if (Call.getReturnValueNode().getNode() && RetVal.getNode())
+ RetVal.mergeWith(Call.getReturnValueNode());
// Loop over all pointer arguments, resolving them to their provided pointers
unsigned ArgIdx = 2; // Skip retval and function to call...
@@ -154,13 +154,13 @@ bool Steens::run(Module &M) {
// Now that we have all of the graphs inlined, we can go about eliminating
// call nodes...
//
- std::vector<std::vector<DSNodeHandle> > &Calls =
+ std::vector<DSCallSite> &Calls =
ResultGraph->getFunctionCalls();
for (unsigned i = 0; i != Calls.size(); ) {
- std::vector<DSNodeHandle> &CurCall = Calls[i];
+ DSCallSite &CurCall = Calls[i];
// Loop over the called functions, eliminating as many as possible...
- std::vector<GlobalValue*> CallTargets = CurCall[1].getNode()->getGlobals();
+ std::vector<GlobalValue*> CallTargets = CurCall.getCalleeNode().getNode()->getGlobals();
for (unsigned c = 0; c != CallTargets.size(); ) {
// If we can eliminate this function call, do so!
bool Eliminated = false;
OpenPOWER on IntegriCloud