diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-10-20 18:07:37 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-10-20 18:07:37 +0000 |
commit | 42fd16931099f528228f020596f7fb5ef5ea8b7f (patch) | |
tree | 498b7b2b1e394707ab5e23938a63e2265c732c1a /lib/Analysis/DataStructure/Steensgaard.cpp | |
parent | 726bafda652754096ee4d3c8ceb07aa8d105f8b9 (diff) | |
download | external_llvm-42fd16931099f528228f020596f7fb5ef5ea8b7f.zip external_llvm-42fd16931099f528228f020596f7fb5ef5ea8b7f.tar.gz external_llvm-42fd16931099f528228f020596f7fb5ef5ea8b7f.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Steensgaard.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/Steensgaard.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp index 2cd7237..9bc3db7 100644 --- a/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/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; |