From baf4500b3ab128c78932e36f96086c0487c8c7d1 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 14 Sep 2006 07:30:48 +0000 Subject: The top bit is used to determine whether it's a MachineConstantPoolValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30324 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/SelectionDAGNodes.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 53ba38f..b830dc3 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1150,7 +1150,7 @@ class ConstantPoolSDNode : public SDNode { Constant *ConstVal; MachineConstantPoolValue *MachineCPVal; } Val; - int Offset; + int Offset; // It's a MachineConstantPoolValue if top bit is set. unsigned Alignment; protected: friend class SelectionDAG; @@ -1200,7 +1200,9 @@ public: return Val.MachineCPVal; } - int getOffset() const { return Offset; } + int getOffset() const { + return Offset & ~(1 << (sizeof(unsigned)*8-1)); + } // Return the alignment of this constant pool object, which is either 0 (for // default alignment) or log2 of the desired value. -- cgit v1.1