diff options
Diffstat (limited to 'lib/Target/SparcV9/SparcV9AsmPrinter.cpp')
-rw-r--r-- | lib/Target/SparcV9/SparcV9AsmPrinter.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp index addcbdc..0be404d 100644 --- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp +++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp @@ -365,23 +365,21 @@ void AsmPrinter::printConstantValueOnly(const Constant* CV, toAsm << "\t" << ".ascii" << "\t" << getAsCString(CVA) << "\n"; } else { // Not a string. Print the values in successive locations - const std::vector<Use> &constValues = CVA->getValues(); - for (unsigned i=0; i < constValues.size(); i++) - printConstantValueOnly(cast<Constant>(constValues[i].get())); + for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i) + printConstantValueOnly(CVA->getOperand(i)); } } else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) { // Print the fields in successive locations. Pad to align if needed! const StructLayout *cvsLayout = Target.getTargetData().getStructLayout(CVS->getType()); - const std::vector<Use>& constValues = CVS->getValues(); unsigned sizeSoFar = 0; - for (unsigned i=0, N = constValues.size(); i < N; i++) { - const Constant* field = cast<Constant>(constValues[i].get()); + for (unsigned i = 0, e = CVS->getNumOperands(); i != e; ++i) { + const Constant* field = CVS->getOperand(i); // Check if padding is needed and insert one or more 0s. unsigned fieldSize = Target.getTargetData().getTypeSize(field->getType()); - int padSize = ((i == N-1? cvsLayout->StructSize + int padSize = ((i == e-1? cvsLayout->StructSize : cvsLayout->MemberOffsets[i+1]) - cvsLayout->MemberOffsets[i]) - fieldSize; sizeSoFar += (fieldSize + padSize); |