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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11175 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2004-02-08 01:27:18 +00:00
parent 9857c1a6ae
commit 4ff0b9636d
5 changed files with 23 additions and 5 deletions

View File

@ -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