aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 53ba38ffee..b830dc3d84 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.