aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-09-14 07:35:00 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-09-14 07:35:00 +0000
commitd5a99d781053f7809dc3f3ae2359b92c084d4659 (patch)
tree19c8f2b9eaa88ee2973f2225a6657a1320cde0d7 /lib
parentf37992428704e378854d0ca8f6aec5a8e22fd133 (diff)
Use MachineConstantPoolEntry getOffset() and getType() accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30326 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index e3cfc06c98..f6b4bfcbfe 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -129,8 +129,7 @@ void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) {
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 @@ void AsmPrinter::EmitConstantPool(unsigned Alignment, const char *Section,
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);
}
}
}