[cfe-commits] r82560 - /cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
Anders Carlsson
andersca at mac.com
Tue Sep 22 11:21:58 PDT 2009
Author: andersca
Date: Tue Sep 22 13:21:58 2009
New Revision: 82560
URL: http://llvm.org/viewvc/llvm-project?rev=82560&view=rev
Log:
Explicitly initialize the PrimaryBase and PrimaryBaseWasVirtual members.
Modified:
cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=82560&r1=82559&r2=82560&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Tue Sep 22 13:21:58 2009
@@ -23,13 +23,13 @@
ASTRecordLayoutBuilder::ASTRecordLayoutBuilder(ASTContext &Ctx)
: Ctx(Ctx), Size(0), Alignment(8), Packed(false), MaxFieldAlignment(0),
- NextOffset(0), IsUnion(false), NonVirtualSize(0), NonVirtualAlignment(8) {}
+ NextOffset(0), IsUnion(false), NonVirtualSize(0), NonVirtualAlignment(8),
+ PrimaryBase(0), PrimaryBaseWasVirtual(false) {}
/// LayoutVtable - Lay out the vtable and set PrimaryBase.
void ASTRecordLayoutBuilder::LayoutVtable(const CXXRecordDecl *RD) {
if (!RD->isDynamicClass()) {
// There is no primary base in this case.
- setPrimaryBase(0, false);
return;
}
@@ -149,10 +149,8 @@
// If we have no virtual bases at this point, bail out as the searching below
// is expensive.
- if (RD->getNumVBases() == 0) {
- setPrimaryBase(0, false);
+ if (RD->getNumVBases() == 0)
return;
- }
// Then we can search for the first nearly empty virtual base itself.
const CXXRecordDecl *FirstPrimary = 0;
More information about the cfe-commits
mailing list