[llvm-commits] CVS: llvm/include/llvm/Analysis/DSGraphTraits.h
Chris Lattner
lattner at cs.uiuc.edu
Sun Feb 29 19:43:01 PST 2004
Changes in directory llvm/include/llvm/Analysis:
DSGraphTraits.h updated: 1.19 -> 1.20
---
Log message:
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.
---
Diffs of the changes: (+8 -4)
Index: llvm/include/llvm/Analysis/DSGraphTraits.h
diff -u llvm/include/llvm/Analysis/DSGraphTraits.h:1.19 llvm/include/llvm/Analysis/DSGraphTraits.h:1.20
--- llvm/include/llvm/Analysis/DSGraphTraits.h:1.19 Sat Feb 7 17:57:09 2004
+++ llvm/include/llvm/Analysis/DSGraphTraits.h Sun Feb 29 19:42:26 2004
@@ -33,10 +33,14 @@
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)
More information about the llvm-commits
mailing list