1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Add an assertion and a method

llvm-svn: 17353
This commit is contained in:
Chris Lattner 2004-10-30 04:03:47 +00:00
parent f7f0cc323e
commit 5242fcc785

View File

@ -95,9 +95,13 @@ public:
// 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 @@ public:
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