Add MachineConstantPoolEntry getOffset() accessor.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 14 Sep 2006 07:32:32 +0000 (07:32 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 14 Sep 2006 07:32:32 +0000 (07:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30325 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineConstantPool.h

index 0185329d0c778a8b4fee61ec1c7c39de5952afb9..1878b527276f6a04e95b7d824380308b3e2f9e3e 100644 (file)
@@ -67,8 +67,8 @@ struct MachineConstantPoolEntry {
     MachineConstantPoolValue *MachineCPVal;
   } Val;
 
-  /// The offset of the constant from the start of the pool. It's really
-  /// 31-bit only. The top bit is set when Val is a MachineConstantPoolValue.
+  /// The offset of the constant from the start of the pool. The top bit is set
+  /// when Val is a MachineConstantPoolValue.
   unsigned Offset;
 
   MachineConstantPoolEntry(Constant *V, unsigned O)
@@ -87,6 +87,10 @@ struct MachineConstantPoolEntry {
     return (int)Offset < 0;
   }
 
+  int getOffset() const { 
+    return Offset & ~(1 << (sizeof(unsigned)*8-1));
+  }
+
   const Type *getType() const;
 };