diff options
author | Anders Carlsson <andersca@mac.com> | 2009-09-13 17:55:13 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-09-13 17:55:13 +0000 |
commit | e0c8822eec9d3b2afa62c5e6168a8a8f52aeb2c4 (patch) | |
tree | 5d69ce320bed90af9971bf8766772f40e48d0fb1 /lib/CodeGen/CGDecl.cpp | |
parent | 0b4b41099b435344006148d2a55c429582d11853 (diff) |
Fix another byref bug. This should hopefully get QuickLookPlugins building successfully.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 926e5c6686..31e74f05e4 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -270,18 +270,18 @@ const llvm::Type *CodeGenFunction::BuildByRefType(const ValueDecl *D) { llvm::RoundUpToAlignment(CurrentOffsetInBytes, Align); unsigned NumPaddingBytes = AlignedOffsetInBytes - CurrentOffsetInBytes; - assert(NumPaddingBytes > 0 && "Can't append any padding!"); + if (NumPaddingBytes > 0) { + const llvm::Type *Ty = llvm::Type::getInt8Ty(VMContext); + // FIXME: We need a sema error for alignment larger than the minimum of the + // maximal stack alignmint and the alignment of malloc on the system. + if (NumPaddingBytes > 1) + Ty = llvm::ArrayType::get(Ty, NumPaddingBytes); - const llvm::Type *Ty = llvm::Type::getInt8Ty(VMContext); - // FIXME: We need a sema error for alignment larger than the minimum of the - // maximal stack alignmint and the alignment of malloc on the system. - if (NumPaddingBytes > 1) - Ty = llvm::ArrayType::get(Ty, NumPaddingBytes); - - Types.push_back(Ty); + Types.push_back(Ty); - // We want a packed struct. - Packed = true; + // We want a packed struct. + Packed = true; + } } // T x; |