summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-11-22 00:03:08 +0000
committerAnders Carlsson <andersca@mac.com>2010-11-22 00:03:08 +0000
commit39a6b22023ba9aa3e20df5a8f6026f17bda976cd (patch)
treee11e9d5a0b418045e706ace2edecaa054f5cb397 /clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
parenta7dd96ce776d45f76a0fc0ae726f169591c9eafe (diff)
downloadbcm5719-llvm-39a6b22023ba9aa3e20df5a8f6026f17bda976cd.tar.gz
bcm5719-llvm-39a6b22023ba9aa3e20df5a8f6026f17bda976cd.zip
Remove FIXME; we don't ever want to lay out empty bases.
llvm-svn: 119957
Diffstat (limited to 'clang/lib/CodeGen/CGRecordLayoutBuilder.cpp')
-rw-r--r--clang/lib/CodeGen/CGRecordLayoutBuilder.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
index 0d9c6d49642..9e45df886e6 100644
--- a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
+++ b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
@@ -487,18 +487,17 @@ void CGRecordLayoutBuilder::LayoutUnion(const RecordDecl *D) {
void CGRecordLayoutBuilder::LayoutNonVirtualBase(const CXXRecordDecl *BaseDecl,
uint64_t BaseOffset) {
+ // Ignore empty bases.
+ if (BaseDecl->isEmpty())
+ return;
+
+ CheckZeroInitializable(BaseDecl);
+
const ASTRecordLayout &Layout =
Types.getContext().getASTRecordLayout(BaseDecl);
uint64_t NonVirtualSize = Layout.getNonVirtualSize();
- if (BaseDecl->isEmpty()) {
- // FIXME: Lay out empty bases.
- return;
- }
-
- CheckZeroInitializable(BaseDecl);
-
// FIXME: Actually use a better type than [sizeof(BaseDecl) x i8] when we can.
AppendPadding(BaseOffset / 8, 1);
OpenPOWER on IntegriCloud