diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-10-20 21:41:02 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-10-20 21:41:02 +0000 |
commit | 26b98265b7edb493e220822e7967c0eb15d52fa6 (patch) | |
tree | 7c1d487f863f2b39b5883224dab372f3be53191c /lib/Analysis/DataStructure/DataStructure.cpp | |
parent | e80fe61a72b974c423f0754990d81eb607891c46 (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/DataStructure.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/DataStructure.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index 3a55c5420b..356736289c 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -6,6 +6,8 @@ #include "llvm/Analysis/DSGraph.h" #include "llvm/Function.h" +#include "llvm/BasicBlock.h" +#include "llvm/iOther.h" #include "llvm/DerivedTypes.h" #include "llvm/Target/TargetData.h" #include "Support/STLExtras.h" @@ -351,12 +353,15 @@ void DSNode::mergeWith(const DSNodeHandle &NH, unsigned Offset) { } } +// Define here to avoid including iOther.h and BasicBlock.h in DSGraph.h +Function& DSCallSite::getCaller() const { + return * callInst->getParent()->getParent(); +} template<typename _CopierFunction> DSCallSite::DSCallSite(const DSCallSite& FromCall, _CopierFunction nodeCopier) : std::vector<DSNodeHandle>(), - caller(&FromCall.getCaller()), callInst(&FromCall.getCallInst()) { reserve(FromCall.size()); @@ -547,15 +552,15 @@ void DSGraph::markIncompleteNodes(bool markFormalArgs) { // Mark stuff passed into functions calls as being incomplete... for (unsigned i = 0, e = FunctionCalls.size(); i != e; ++i) { - DSCallSite &Args = FunctionCalls[i]; + DSCallSite &Call = FunctionCalls[i]; // Then the return value is certainly incomplete! - markIncompleteNode(Args.getReturnValueNode().getNode()); + markIncompleteNode(Call.getReturnValueNode().getNode()); // The call does not make the function argument incomplete... // All arguments to the function call are incomplete though! - for (unsigned i = 2, e = Args.size(); i != e; ++i) - markIncompleteNode(Args[i].getNode()); + for (unsigned i = 0, e = Call.getNumPtrArgs(); i != e; ++i) + markIncompleteNode(Call.getPtrArgNode(i).getNode()); } // Mark all of the nodes pointed to by global or cast nodes as incomplete... |