summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-08-08 18:01:57 +0000
committerAnders Carlsson <andersca@mac.com>2009-08-08 18:01:57 +0000
commit453878bed417b8174bda86814cc09226ff8c75f0 (patch)
treec5b24f8692ef9e3e22fd60d9e2e67058fe49bf8e /clang
parent5fd7dad784320a7dc76eb2d7aaae649d697e4f23 (diff)
downloadbcm5719-llvm-453878bed417b8174bda86814cc09226ff8c75f0.tar.gz
bcm5719-llvm-453878bed417b8174bda86814cc09226ff8c75f0.zip
Assert that the LLVM type has the same size as the RecordDecl size.
llvm-svn: 78481
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGRecordLayoutBuilder.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
index 241a6e5395d..a119d4f3a40 100644
--- a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
+++ b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
@@ -301,6 +301,9 @@ CGRecordLayoutBuilder::ComputeLayout(CodeGenTypes &Types,
const llvm::Type *Ty = llvm::StructType::get(Types.getLLVMContext(),
Builder.FieldTypes,
Builder.Packed);
+ assert(Types.getContext().getASTRecordLayout(D).getSize() / 8 ==
+ Types.getTargetData().getTypeAllocSize(Ty) &&
+ "Type size mismatch!");
// Add all the field numbers.
for (unsigned i = 0, e = Builder.LLVMFields.size(); i != e; ++i) {
OpenPOWER on IntegriCloud