diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-03-01 01:42:26 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-03-01 01:42:26 +0000 |
| commit | 482cf01a1e9c422c81ba6fe1ae5f386fbb839768 (patch) | |
| tree | 3eac93a87c1a4fd55b96e9344621022949a57d63 /llvm | |
| parent | b4c203ce67595a7b44b37497ed80887b760bcca9 (diff) | |
| download | bcm5719-llvm-482cf01a1e9c422c81ba6fe1ae5f386fbb839768.tar.gz bcm5719-llvm-482cf01a1e9c422c81ba6fe1ae5f386fbb839768.zip | |
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
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Analysis/DSGraphTraits.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/include/llvm/Analysis/DSGraphTraits.h b/llvm/include/llvm/Analysis/DSGraphTraits.h index 72541b8cd1f..017d86f0b54 100644 --- a/llvm/include/llvm/Analysis/DSGraphTraits.h +++ b/llvm/include/llvm/Analysis/DSGraphTraits.h @@ -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, bool) : Node(N) { // Create end iterator - Offset = N->getNumLinks() << DS::PointerShift; - if (Offset == 0 && Node->getForwardNode() && - Node->isDeadNode()) // Model Forward link - Offset += DS::PointerSize; + if (N != 0) { + Offset = N->getNumLinks() << DS::PointerShift; + if (Offset == 0 && Node->getForwardNode() && + Node->isDeadNode()) // Model Forward link + Offset += DS::PointerSize; + } else { + Offset = 0; + } } public: DSNodeIterator(const DSNodeHandle &NH) |

