aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-09-14 07:32:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-09-14 07:32:32 +0000
commitf37992428704e378854d0ca8f6aec5a8e22fd133 (patch)
treecd6ed405536c995d8f3915a5ecc17e5bea21ea45 /include
parentbaf4500b3ab128c78932e36f96086c0487c8c7d1 (diff)
downloadexternal_llvm-f37992428704e378854d0ca8f6aec5a8e22fd133.zip
external_llvm-f37992428704e378854d0ca8f6aec5a8e22fd133.tar.gz
external_llvm-f37992428704e378854d0ca8f6aec5a8e22fd133.tar.bz2
Add MachineConstantPoolEntry getOffset() accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30325 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineConstantPool.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineConstantPool.h b/include/llvm/CodeGen/MachineConstantPool.h
index 0185329..1878b52 100644
--- a/include/llvm/CodeGen/MachineConstantPool.h
+++ b/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;
};