mirror of
https://github.com/intel/llvm.git
synced 2026-02-03 19:18:13 +08:00
Don't initialize virtual pointers for primary bases, they've already been initialized.
llvm-svn: 99612
This commit is contained in:
@@ -1601,6 +1601,13 @@ void CodeGenFunction::InitializeVtablePtrs(BaseSubobject Base,
|
||||
|
||||
CXXRecordDecl *BaseDecl
|
||||
= cast<CXXRecordDecl>(I->getType()->getAs<RecordType>()->getDecl());
|
||||
|
||||
// We don't need to initialize vtable pointers for primary bases, unless
|
||||
// they're virtual.
|
||||
if (!Layout.getPrimaryBaseWasVirtual() &&
|
||||
Layout.getPrimaryBase() == BaseDecl)
|
||||
continue;
|
||||
|
||||
uint64_t BaseOffset = Base.getBaseOffset() +
|
||||
Layout.getBaseClassOffset(BaseDecl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user