From: Anders Carlsson Date: Wed, 24 Nov 2010 23:12:57 +0000 (+0000) Subject: Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9e814ba193f38a7b08268612248f63beb279bb3;p=clang Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120133 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/RecordLayout.h b/include/clang/AST/RecordLayout.h index bed11045ad..25617d86da 100644 --- a/include/clang/AST/RecordLayout.h +++ b/include/clang/AST/RecordLayout.h @@ -209,7 +209,7 @@ public: } // FIXME: Migrate off of this function and use getPrimaryBaseInfo directly. - bool getPrimaryBaseWasVirtual() const { + bool isPrimaryBaseVirtual() const { return getPrimaryBaseInfo().isVirtual(); } diff --git a/lib/AST/CXXInheritance.cpp b/lib/AST/CXXInheritance.cpp index fd14a739df..9853fc2bb2 100644 --- a/lib/AST/CXXInheritance.cpp +++ b/lib/AST/CXXInheritance.cpp @@ -669,7 +669,7 @@ AddIndirectPrimaryBases(const CXXRecordDecl *RD, ASTContext &Context, CXXIndirectPrimaryBaseSet& Bases) { // If the record has a virtual primary base class, add it to our set. const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD); - if (Layout.getPrimaryBaseWasVirtual()) + if (Layout.isPrimaryBaseVirtual()) Bases.insert(Layout.getPrimaryBase()); for (CXXRecordDecl::base_class_const_iterator I = RD->bases_begin(), diff --git a/lib/AST/RecordLayout.cpp b/lib/AST/RecordLayout.cpp index eb83c489c9..a296a2409a 100644 --- a/lib/AST/RecordLayout.cpp +++ b/lib/AST/RecordLayout.cpp @@ -68,7 +68,7 @@ ASTRecordLayout::ASTRecordLayout(ASTContext &Ctx, #ifndef NDEBUG if (const CXXRecordDecl *PrimaryBase = getPrimaryBase()) { - if (getPrimaryBaseWasVirtual()) + if (isPrimaryBaseVirtual()) assert(getVBaseClassOffset(PrimaryBase).isZero() && "Primary virtual base must be at offset 0!"); else diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp index d97dcd1c3f..0e94ac7e1c 100644 --- a/lib/AST/RecordLayoutBuilder.cpp +++ b/lib/AST/RecordLayoutBuilder.cpp @@ -857,7 +857,7 @@ RecordLayoutBuilder::ComputeBaseSubobjectInfo(const CXXRecordDecl *RD, // Check if this base has a primary virtual base. if (RD->getNumVBases()) { const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD); - if (Layout.getPrimaryBaseWasVirtual()) { + if (Layout.isPrimaryBaseVirtual()) { // This base does have a primary virtual base. PrimaryVirtualBase = Layout.getPrimaryBase(); assert(PrimaryVirtualBase && "Didn't have a primary virtual base!"); @@ -1045,7 +1045,7 @@ RecordLayoutBuilder::LayoutVirtualBases(const CXXRecordDecl *RD, } else { const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD); PrimaryBase = Layout.getPrimaryBase(); - PrimaryBaseIsVirtual = Layout.getPrimaryBaseWasVirtual(); + PrimaryBaseIsVirtual = Layout.isPrimaryBaseVirtual(); } for (CXXRecordDecl::base_class_const_iterator I = RD->bases_begin(), diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index cc5b1986a9..e033d2fa69 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1045,7 +1045,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, while (1) { const ASTRecordLayout &BRL = CGM.getContext().getASTRecordLayout(PBase); const CXXRecordDecl *PBT = BRL.getPrimaryBase(); - if (PBT && !BRL.getPrimaryBaseWasVirtual()) + if (PBT && !BRL.isPrimaryBaseVirtual()) PBase = PBT; else break; diff --git a/lib/CodeGen/CGRecordLayoutBuilder.cpp b/lib/CodeGen/CGRecordLayoutBuilder.cpp index fcaf1e112d..ff0a2eafd3 100644 --- a/lib/CodeGen/CGRecordLayoutBuilder.cpp +++ b/lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -527,7 +527,7 @@ CGRecordLayoutBuilder::LayoutNonVirtualBases(const CXXRecordDecl *RD, AppendField(NextFieldOffsetInBytes, VTableTy->getPointerTo()); } else { // FIXME: Handle a virtual primary base. - if (!Layout.getPrimaryBaseWasVirtual()) + if (!Layout.isPrimaryBaseVirtual()) LayoutNonVirtualBase(PrimaryBase, 0); } } @@ -542,7 +542,7 @@ CGRecordLayoutBuilder::LayoutNonVirtualBases(const CXXRecordDecl *RD, cast(I->getType()->getAs()->getDecl()); // We've already laid out the primary base. - if (BaseDecl == PrimaryBase && !Layout.getPrimaryBaseWasVirtual()) + if (BaseDecl == PrimaryBase && !Layout.isPrimaryBaseVirtual()) continue; LayoutNonVirtualBase(BaseDecl, Layout.getBaseClassOffsetInBits(BaseDecl)); diff --git a/lib/CodeGen/CGVTT.cpp b/lib/CodeGen/CGVTT.cpp index 91bac4cd0f..8c642dc816 100644 --- a/lib/CodeGen/CGVTT.cpp +++ b/lib/CodeGen/CGVTT.cpp @@ -270,7 +270,7 @@ VTTBuilder::LayoutSecondaryVirtualPointers(BaseSubobject Base, BaseOffset = Base.getBaseOffset() + Layout.getBaseClassOffsetInBits(BaseDecl); - if (!Layout.getPrimaryBaseWasVirtual() && + if (!Layout.isPrimaryBaseVirtual() && Layout.getPrimaryBase() == BaseDecl) BaseDeclIsNonVirtualPrimaryBase = true; } diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index c40f437c6a..ad648c62f5 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -793,7 +793,7 @@ VCallAndVBaseOffsetBuilder::AddVCallAndVBaseOffsets(BaseSubobject Base, // (Since we're emitting the vcall and vbase offsets in reverse order, we'll // emit them for the primary base first). if (const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase()) { - bool PrimaryBaseIsVirtual = Layout.getPrimaryBaseWasVirtual(); + bool PrimaryBaseIsVirtual = Layout.isPrimaryBaseVirtual(); uint64_t PrimaryBaseOffset; @@ -849,7 +849,7 @@ void VCallAndVBaseOffsetBuilder::AddVCallOffsets(BaseSubobject Base, // Handle the primary base first. // We only want to add vcall offsets if the base is non-virtual; a virtual // primary base will have its vcall and vbase offsets emitted already. - if (PrimaryBase && !Layout.getPrimaryBaseWasVirtual()) { + if (PrimaryBase && !Layout.isPrimaryBaseVirtual()) { // Get the base offset of the primary base. assert(Layout.getBaseClassOffsetInBits(PrimaryBase) == 0 && "Primary base should have a zero offset!"); @@ -1520,7 +1520,7 @@ VTableBuilder::IsOverriderUsed(const CXXMethodDecl *Overrider, if (!PrimaryBase) break; - if (Layout.getPrimaryBaseWasVirtual()) { + if (Layout.isPrimaryBaseVirtual()) { assert(Layout.getVBaseClassOffsetInBits(PrimaryBase) == 0 && "Primary base should always be at offset 0!"); @@ -1586,7 +1586,7 @@ VTableBuilder::AddMethods(BaseSubobject Base, uint64_t BaseOffsetInLayoutClass, if (const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase()) { uint64_t PrimaryBaseOffset; uint64_t PrimaryBaseOffsetInLayoutClass; - if (Layout.getPrimaryBaseWasVirtual()) { + if (Layout.isPrimaryBaseVirtual()) { assert(Layout.getVBaseClassOffsetInBits(PrimaryBase) == 0 && "Primary vbase should have a zero offset!"); @@ -1788,7 +1788,7 @@ VTableBuilder::LayoutPrimaryAndSecondaryVTables(BaseSubobject Base, if (!PrimaryBase) break; - if (Layout.getPrimaryBaseWasVirtual()) { + if (Layout.isPrimaryBaseVirtual()) { // Check if this virtual primary base is a primary base in the layout // class. If it's not, we don't want to add it. const ASTRecordLayout &LayoutClassLayout = @@ -1875,7 +1875,7 @@ VTableBuilder::DeterminePrimaryVirtualBases(const CXXRecordDecl *RD, if (const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase()) { // Check if it's virtual. - if (Layout.getPrimaryBaseWasVirtual()) { + if (Layout.isPrimaryBaseVirtual()) { bool IsPrimaryVirtualBase = true; if (isBuildingConstructorVTable()) {