From 0460f42da9f812cbdcc4dc86cf7c89385ef46d1c Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 14 Sep 2006 07:32:32 +0000 Subject: [PATCH] Add MachineConstantPoolEntry getOffset() accessor. llvm-svn: 30325 --- llvm/include/llvm/CodeGen/MachineConstantPool.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/CodeGen/MachineConstantPool.h b/llvm/include/llvm/CodeGen/MachineConstantPool.h index 0185329d0c77..1878b527276f 100644 --- a/llvm/include/llvm/CodeGen/MachineConstantPool.h +++ b/llvm/include/llvm/CodeGen/MachineConstantPool.h @@ -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; };