diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-30 04:03:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-30 04:03:47 +0000 |
commit | 5b3ed508f62ed09cec4162633cb074c424106c16 (patch) | |
tree | a3fd3d9a773e724f7f4c0cc26bbfeacee90a4053 /include/llvm | |
parent | c74ea9f3b0f5e911f21cd211370ff192efa27edc (diff) | |
download | external_llvm-5b3ed508f62ed09cec4162633cb074c424106c16.zip external_llvm-5b3ed508f62ed09cec4162633cb074c424106c16.tar.gz external_llvm-5b3ed508f62ed09cec4162633cb074c424106c16.tar.bz2 |
Add an assertion and a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSSupport.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index e5bf390..6dbd36b 100644 --- a/include/llvm/Analysis/DataStructure/DSSupport.h +++ b/include/llvm/Analysis/DataStructure/DSSupport.h @@ -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 |