[llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp
Evan Cheng
evan.cheng at apple.com
Wed Sep 13 22:51:11 PDT 2006
Changes in directory llvm/lib/CodeGen:
MachineFunction.cpp updated: 1.98 -> 1.99
---
Log message:
A MachineConstantPool may have mixed Constant* and MachineConstantPoolValue* values.
---
Diffs of the changes: (+8 -2)
MachineFunction.cpp | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
Index: llvm/lib/CodeGen/MachineFunction.cpp
diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.98 llvm/lib/CodeGen/MachineFunction.cpp:1.99
--- llvm/lib/CodeGen/MachineFunction.cpp:1.98 Tue Sep 12 16:00:35 2006
+++ llvm/lib/CodeGen/MachineFunction.cpp Thu Sep 14 00:50:57 2006
@@ -351,6 +351,12 @@
// 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 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 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;
}
More information about the llvm-commits
mailing list