summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-08 01:27:18 +0000
committerChris Lattner <sabre@nondot.org>2004-02-08 01:27:18 +0000
commitb0f32183e44008b9f3bd7ae2116aba8c7c23f142 (patch)
treeed90577eaa9b2503409571e610d4a22516bb9e59 /llvm/lib/Analysis/DataStructure/DataStructure.cpp
parent5592af79276518d838c38ce986b955e3dbe06d69 (diff)
downloadbcm5719-llvm-b0f32183e44008b9f3bd7ae2116aba8c7c23f142.tar.gz
bcm5719-llvm-b0f32183e44008b9f3bd7ae2116aba8c7c23f142.zip
Substantially improve the DSA code by removing 'forwarding' nodes from
DSGraphs while they are forwarding. When the last reference to the forwarding node is dropped, the forwarding node is autodeleted. This should simplify removeTriviallyDead nodes, and is only (efficiently) possible because we are using an ilist of dsnodes now. llvm-svn: 11175
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index 57651d78e1e..68530f043ed 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
@@ -46,7 +46,7 @@ namespace {
using namespace DS;
DSNode *DSNodeHandle::HandleForwarding() const {
- assert(!N->ForwardNH.isNull() && "Can only be invoked if forwarding!");
+ assert(N->isForwarding() && "Can only be invoked if forwarding!");
// Handle node forwarding here!
DSNode *Next = N->ForwardNH.getNode(); // Cause recursive shrinkage
@@ -124,6 +124,10 @@ void DSNode::forwardNode(DSNode *To, unsigned Offset) {
NodeType = DEAD;
Size = 0;
Ty = Type::VoidTy;
+
+ // Remove this node from the parent graph's Nodes list.
+ ParentGraph->unlinkNode(this);
+ ParentGraph = 0;
}
// addGlobal - Add an entry for a global value to the Globals list. This also
OpenPOWER on IntegriCloud