aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/DataStructure/DSGraph.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-05 21:59:58 +0000
committerChris Lattner <sabre@nondot.org>2003-02-05 21:59:58 +0000
commit923fc05b3a95efad270b283f97b2670152a41efb (patch)
treef57c34bd5de4a4e4b59c46847c9da54894f2bf9e /include/llvm/Analysis/DataStructure/DSGraph.h
parentbbe5ac1458f3719fd51785f086e9166ccbb0c464 (diff)
Implement optimization for direct function call case. This dramatically
reduces the number of function nodes created and speeds up analysis by about 10% overall. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructure/DSGraph.h')
-rw-r--r--include/llvm/Analysis/DataStructure/DSGraph.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/Analysis/DataStructure/DSGraph.h b/include/llvm/Analysis/DataStructure/DSGraph.h
index c5e9396a16..a09602293d 100644
--- a/include/llvm/Analysis/DataStructure/DSGraph.h
+++ b/include/llvm/Analysis/DataStructure/DSGraph.h
@@ -184,7 +184,7 @@ public:
void mergeInGraph(DSCallSite &CS, const DSGraph &Graph, unsigned CloneFlags);
// Methods for checking to make sure graphs are well formed...
- void AssertNodeInGraph(DSNode *N) const {
+ void AssertNodeInGraph(const DSNode *N) const {
assert((!N || find(Nodes.begin(), Nodes.end(), N) != Nodes.end()) &&
"AssertNodeInGraph: Node is not in graph!");
}
@@ -194,7 +194,8 @@ public:
}
void AssertCallSiteInGraph(const DSCallSite &CS) const {
- AssertNodeInGraph(CS.getCallee().getNode());
+ if (CS.isIndirectCall())
+ AssertNodeInGraph(CS.getCalleeNode());
AssertNodeInGraph(CS.getRetVal().getNode());
for (unsigned j = 0, e = CS.getNumPtrArgs(); j != e; ++j)
AssertNodeInGraph(CS.getPtrArg(j).getNode());