diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-10 19:59:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-10 19:59:22 +0000 |
commit | b0c39a3b4d1daa93d339493751976944b6422fd5 (patch) | |
tree | 4d9453ed7216ac3d8eca387291edad4de4f6e5cc /lib/CodeGen/AsmPrinter.cpp | |
parent | b1919e2f08ecb37140af676fd2916f8d5ed7df3d (diff) |
encapsulate the rest of the StructLayout members.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 6dac1ea375..2d7dec40f7 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -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)) { |