The top bit is used to determine whether it's a MachineConstantPoolValue.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 14 Sep 2006 07:30:48 +0000 (07:30 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 14 Sep 2006 07:30:48 +0000 (07:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30324 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h

index 53ba38ffee0e72d5208acbb90468ee5ad2b20735..b830dc3d845519685ff8633a5c697375e8607b16 100644 (file)
@@ -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.