[llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/DSSupport.h
Chris Lattner
lattner at cs.uiuc.edu
Fri Oct 29 21:04:02 PDT 2004
Changes in directory llvm/include/llvm/Analysis/DataStructure:
DSSupport.h updated: 1.33 -> 1.34
---
Log message:
Add an assertion and a method
---
Diffs of the changes: (+9 -1)
Index: llvm/include/llvm/Analysis/DataStructure/DSSupport.h
diff -u llvm/include/llvm/Analysis/DataStructure/DSSupport.h:1.33 llvm/include/llvm/Analysis/DataStructure/DSSupport.h:1.34
--- llvm/include/llvm/Analysis/DataStructure/DSSupport.h:1.33 Wed Sep 1 17:55:34 2004
+++ llvm/include/llvm/Analysis/DataStructure/DSSupport.h Fri Oct 29 23:03:47 2004
@@ -95,9 +95,13 @@
// Allow explicit conversion to DSNode...
inline DSNode *getNode() const; // Defined inline in DSNode.h
- unsigned getOffset() const { return Offset; }
+ unsigned getOffset() const {
+ assert(!isForwarding() && "This is a forwarding NH, call getNode() first!");
+ return Offset;
+ }
void setOffset(unsigned O) {
+ assert(!isForwarding() && "This is a forwarding NH, call getNode() first!");
//assert((!N || Offset < N->Size || (N->Size == 0 && Offset == 0) ||
// !N->ForwardNH.isNull()) && "Node handle offset out of range!");
//assert((!N || O < N->Size || (N->Size == 0 && O == 0) ||
@@ -128,6 +132,10 @@
inline void setLink(unsigned Num, const DSNodeHandle &NH);
private:
DSNode *HandleForwarding() const;
+
+ /// isForwarding - Return true if this NodeHandle is forwarding to another
+ /// one.
+ bool isForwarding() const;
};
} // End llvm namespace
More information about the llvm-commits
mailing list