// MachineConstantPool implementation
//===----------------------------------------------------------------------===//
+const Type *MachineConstantPoolEntry::getType() const {
+ if (isMachineConstantPoolEntry())
+ return Val.MachineCPVal->getType();
+ return Val.ConstVal->getType();
+}
+
MachineConstantPool::~MachineConstantPool() {
for (unsigned i = 0, e = Constants.size(); i != e; ++i)
if (Constants[i].isMachineConstantPoolEntry())
unsigned Offset = 0;
if (!Constants.empty()) {
Offset = Constants.back().Offset;
- Offset += TD->getTypeSize(Constants.back().Val.ConstVal->getType());
+ Offset += TD->getTypeSize(Constants.back().getType());
Offset = (Offset+AlignMask)&~AlignMask;
}
unsigned Offset = 0;
if (!Constants.empty()) {
Offset = Constants.back().Offset;
- Offset += TD->getTypeSize(Constants.back().Val.MachineCPVal->getType());
+ Offset += TD->getTypeSize(Constants.back().getType());
Offset = (Offset+AlignMask)&~AlignMask;
}