diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-11-30 01:19:33 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-11-30 01:19:33 +0000 |
commit | 76ed1f76f986a2c052654b81e2ed9dfb86dd79d8 (patch) | |
tree | 0fb8365c42f47c16b6cf285186e66b687f873487 | |
parent | 9e612408c237ce3cac3fe7e97d7ce564601c1f63 (diff) |
Minor cleanup (no functionality change).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90105 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index eb8a1dbb4d..9625dd296a 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -205,8 +205,6 @@ public: SeenVBase.clear(); } - Index_t VBlookup(CXXRecordDecl *D, CXXRecordDecl *B); - Index_t getNVOffset_1(const CXXRecordDecl *D, const CXXRecordDecl *B, Index_t Offset = 0) { @@ -252,7 +250,7 @@ public: CXXRecordDecl *D = cast<CXXRecordDecl>(qD->getAs<RecordType>()->getDecl()); CXXRecordDecl *B = cast<CXXRecordDecl>(qB->getAs<RecordType>()->getDecl()); if (D != Class) - return VBlookup(D, B); + return CGM.getVtableInfo().getVirtualBaseOffsetIndex(D, B); llvm::DenseMap<const CXXRecordDecl *, Index_t>::iterator i; i = VBIndex.find(B); if (i != VBIndex.end()) @@ -455,7 +453,7 @@ public: } void AddMethod(const GlobalDecl GD, bool MorallyVirtual, Index_t Offset, - bool ForVirtualBase, int64_t CurrentVBaseOffset) { + int64_t CurrentVBaseOffset) { llvm::Constant *m = WrapAddrOf(GD); // If we can find a previously allocated slot for this, reuse it. @@ -487,8 +485,7 @@ public: } void AddMethods(const CXXRecordDecl *RD, bool MorallyVirtual, - Index_t Offset, bool RDisVirtualBase, - int64_t CurrentVBaseOffset) { + Index_t Offset, int64_t CurrentVBaseOffset) { for (method_iter mi = RD->method_begin(), me = RD->method_end(); mi != me; ++mi) { const CXXMethodDecl *MD = *mi; @@ -499,12 +496,11 @@ public: // For destructors, add both the complete and the deleting destructor // to the vtable. AddMethod(GlobalDecl(DD, Dtor_Complete), MorallyVirtual, Offset, - RDisVirtualBase, CurrentVBaseOffset); + CurrentVBaseOffset); AddMethod(GlobalDecl(DD, Dtor_Deleting), MorallyVirtual, Offset, - RDisVirtualBase, CurrentVBaseOffset); - } else - AddMethod(MD, MorallyVirtual, Offset, RDisVirtualBase, CurrentVBaseOffset); + } else + AddMethod(MD, MorallyVirtual, Offset, CurrentVBaseOffset); } } @@ -630,7 +626,7 @@ public: void Primaries(const CXXRecordDecl *RD, bool MorallyVirtual, int64_t Offset, bool updateVBIndex, Index_t current_vbindex, - bool RDisVirtualBase, int64_t CurrentVBaseOffset) { + int64_t CurrentVBaseOffset) { if (!RD->isDynamicClass()) return; @@ -649,21 +645,20 @@ public: if (!PrimaryBaseWasVirtual) Primaries(PrimaryBase, PrimaryBaseWasVirtual|MorallyVirtual, Offset, - updateVBIndex, current_vbindex, PrimaryBaseWasVirtual, - BaseCurrentVBaseOffset); + updateVBIndex, current_vbindex, BaseCurrentVBaseOffset); } D1(printf(" doing vcall entries for %s most derived %s\n", RD->getNameAsCString(), Class->getNameAsCString())); // And add the virtuals for the class to the primary vtable. - AddMethods(RD, MorallyVirtual, Offset, RDisVirtualBase, CurrentVBaseOffset); + AddMethods(RD, MorallyVirtual, Offset, CurrentVBaseOffset); } void VBPrimaries(const CXXRecordDecl *RD, bool MorallyVirtual, int64_t Offset, bool updateVBIndex, Index_t current_vbindex, bool RDisVirtualBase, int64_t CurrentVBaseOffset, - bool bottom=false) { + bool bottom) { if (!RD->isDynamicClass()) return; @@ -684,7 +679,7 @@ public: VBPrimaries(PrimaryBase, PrimaryBaseWasVirtual|MorallyVirtual, Offset, updateVBIndex, current_vbindex, PrimaryBaseWasVirtual, - BaseCurrentVBaseOffset); + BaseCurrentVBaseOffset, false); } D1(printf(" doing vbase entries for %s most derived %s\n", @@ -693,7 +688,7 @@ public: if (RDisVirtualBase || bottom) { Primaries(RD, MorallyVirtual, Offset, updateVBIndex, current_vbindex, - RDisVirtualBase, CurrentVBaseOffset); + CurrentVBaseOffset); } } @@ -776,12 +771,6 @@ public: } }; - -VtableBuilder::Index_t VtableBuilder::VBlookup(CXXRecordDecl *D, - CXXRecordDecl *B) { - return CGM.getVtableInfo().getVirtualBaseOffsetIndex(D, B); -} - } /// TypeConversionRequiresAdjustment - Returns whether conversion from a |