mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-23 01:31:05 +00:00
A MachineConstantPool may have mixed Constant* and MachineConstantPoolValue* values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30316 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
544ea34a9f
commit
9abd7c3867
@ -351,6 +351,12 @@ void MachineJumpTableInfo::dump() const { print(std::cerr); }
|
||||
// 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())
|
||||
@ -376,7 +382,7 @@ unsigned MachineConstantPool::getConstantPoolIndex(Constant *C,
|
||||
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;
|
||||
}
|
||||
|
||||
@ -400,7 +406,7 @@ unsigned MachineConstantPool::getConstantPoolIndex(MachineConstantPoolValue *V,
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user