From 26b98265b7edb493e220822e7967c0eb15d52fa6 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Sun, 20 Oct 2002 21:41:02 +0000 Subject: 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 --- lib/Analysis/DataStructure/DataStructure.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib/Analysis/DataStructure/DataStructure.cpp') 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 DSCallSite::DSCallSite(const DSCallSite& FromCall, _CopierFunction nodeCopier) : std::vector(), - 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... -- cgit v1.2.3-18-g5258