encapsulate the rest of the StructLayout members.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2007-02-10 19:59:22 +00:00
parent b1919e2f08
commit b0c39a3b4d
3 changed files with 15 additions and 7 deletions

View File

@ -738,7 +738,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
// Check if padding is needed and insert one or more 0s.
uint64_t fieldSize = TD->getTypeSize(field->getType());
uint64_t padSize = ((i == e-1? cvsLayout->StructSize
uint64_t padSize = ((i == e-1? cvsLayout->getSizeInBytes()
: cvsLayout->getElementOffset(i+1))
- cvsLayout->getElementOffset(i)) - fieldSize;
sizeSoFar += fieldSize + padSize;
@ -749,7 +749,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
// Insert the field padding unless it's zero bytes...
EmitZeros(padSize);
}
assert(sizeSoFar == cvsLayout->StructSize &&
assert(sizeSoFar == cvsLayout->getSizeInBytes() &&
"Layout of constant struct may be incorrect!");
return;
} else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) {