[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp
Evan Cheng
evan.cheng at apple.com
Thu Sep 14 00:35:14 PDT 2006
Changes in directory llvm/lib/CodeGen:
AsmPrinter.cpp updated: 1.94 -> 1.95
---
Log message:
Use MachineConstantPoolEntry getOffset() and getType() accessors.
---
Diffs of the changes: (+7 -13)
AsmPrinter.cpp | 20 +++++++-------------
1 files changed, 7 insertions(+), 13 deletions(-)
Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.94 llvm/lib/CodeGen/AsmPrinter.cpp:1.95
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.94 Tue Sep 12 16:00:35 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp Thu Sep 14 02:35:00 2006
@@ -129,8 +129,7 @@
std::vector<std::pair<MachineConstantPoolEntry,unsigned> > TargetCPs;
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
MachineConstantPoolEntry CPE = CP[i];
- const Type *Ty = CPE.isMachineConstantPoolEntry()
- ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType();
+ const Type *Ty = CPE.getType();
if (TAI->getFourByteConstantSection() &&
TM.getTargetData()->getTypeSize(Ty) == 4)
FourByteCPs.push_back(std::make_pair(CPE, i));
@@ -161,23 +160,18 @@
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << '_'
<< CP[i].second << ":\t\t\t\t\t" << TAI->getCommentString() << " ";
- if (CP[i].first.isMachineConstantPoolEntry()) {
- WriteTypeSymbolic(O, CP[i].first.Val.MachineCPVal->getType(), 0) << '\n';
- printDataDirective(CP[i].first.Val.MachineCPVal->getType());
+ WriteTypeSymbolic(O, CP[i].first.getType(), 0) << '\n';
+ if (CP[i].first.isMachineConstantPoolEntry())
EmitMachineConstantPoolValue(CP[i].first.Val.MachineCPVal);
- } else {
- WriteTypeSymbolic(O, CP[i].first.Val.ConstVal->getType(), 0) << '\n';
+ else
EmitGlobalConstant(CP[i].first.Val.ConstVal);
- }
if (i != e-1) {
- const Type *Ty = CP[i].first.isMachineConstantPoolEntry()
- ? CP[i].first.Val.MachineCPVal->getType()
- : CP[i].first.Val.ConstVal->getType();
+ const Type *Ty = CP[i].first.getType();
unsigned EntSize =
TM.getTargetData()->getTypeSize(Ty);
- unsigned ValEnd = CP[i].first.Offset + EntSize;
+ unsigned ValEnd = CP[i].first.getOffset() + EntSize;
// Emit inter-object padding for alignment.
- EmitZeros(CP[i+1].first.Offset-ValEnd);
+ EmitZeros(CP[i+1].first.getOffset()-ValEnd);
}
}
}
More information about the llvm-commits
mailing list