forked from OSchip/llvm-project
Fix the "partial pool allocator" on em3d and others. The problem is that
DSNodes, unlike other GraphTraits nodes, can have null outgoing edges, and df_iterator doesn't take this into consideration. As a workaround, the successor iterator now handles null nodes and 'indicates' that null has no successors. llvm-svn: 12025
This commit is contained in:
parent
b4c203ce67
commit
482cf01a1e
|
@ -33,10 +33,14 @@ class DSNodeIterator : public forward_iterator<const DSNode, ptrdiff_t> {
|
||||||
|
|
||||||
DSNodeIterator(NodeTy *N) : Node(N), Offset(0) {} // begin iterator
|
DSNodeIterator(NodeTy *N) : Node(N), Offset(0) {} // begin iterator
|
||||||
DSNodeIterator(NodeTy *N, bool) : Node(N) { // Create end iterator
|
DSNodeIterator(NodeTy *N, bool) : Node(N) { // Create end iterator
|
||||||
Offset = N->getNumLinks() << DS::PointerShift;
|
if (N != 0) {
|
||||||
if (Offset == 0 && Node->getForwardNode() &&
|
Offset = N->getNumLinks() << DS::PointerShift;
|
||||||
Node->isDeadNode()) // Model Forward link
|
if (Offset == 0 && Node->getForwardNode() &&
|
||||||
Offset += DS::PointerSize;
|
Node->isDeadNode()) // Model Forward link
|
||||||
|
Offset += DS::PointerSize;
|
||||||
|
} else {
|
||||||
|
Offset = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
DSNodeIterator(const DSNodeHandle &NH)
|
DSNodeIterator(const DSNodeHandle &NH)
|
||||||
|
|
Loading…
Reference in New Issue