r193164 - Drop the unneeded VBase field from MethodInfo in the VFTableBuilder class
Reid Kleckner
rnk at google.com
Tue Oct 22 11:01:12 PDT 2013
Yep, seems fine.
On Tue, Oct 22, 2013 at 7:58 AM, Timur Iskhodzhanov <timurrrr at google.com>wrote:
> Reid,
> Please review post-commit.
> Should be no rocket science here - we only add a method to a given
> vftable if it belongs to the right vbase, so carrying it around wasn't
> necessary.
> --Timur
>
> 2013/10/22 Timur Iskhodzhanov <timurrrr at google.com>:
> > Author: timurrrr
> > Date: Tue Oct 22 09:50:20 2013
> > New Revision: 193164
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=193164&view=rev
> > Log:
> > Drop the unneeded VBase field from MethodInfo in the VFTableBuilder class
> >
> > Modified:
> > cfe/trunk/lib/AST/VTableBuilder.cpp
> >
> > Modified: cfe/trunk/lib/AST/VTableBuilder.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/VTableBuilder.cpp?rev=193164&r1=193163&r2=193164&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/lib/AST/VTableBuilder.cpp (original)
> > +++ cfe/trunk/lib/AST/VTableBuilder.cpp Tue Oct 22 09:50:20 2013
> > @@ -2483,10 +2483,6 @@ private:
> > /// this method's base has, or zero.
> > const uint64_t VBTableIndex;
> >
> > - /// VBase - If nonnull, holds the last vbase which contains the
> vfptr that
> > - /// the method definition is adjusted to.
> > - const CXXRecordDecl *VBase;
> > -
> > /// VFTableIndex - The index in the vftable that this method has.
> > const uint64_t VFTableIndex;
> >
> > @@ -2495,13 +2491,11 @@ private:
> > /// or used for vcalls in the most derived class.
> > bool Shadowed;
> >
> > - MethodInfo(uint64_t VBTableIndex, const CXXRecordDecl *VBase,
> > - uint64_t VFTableIndex)
> > - : VBTableIndex(VBTableIndex), VBase(VBase),
> VFTableIndex(VFTableIndex),
> > + MethodInfo(uint64_t VBTableIndex, uint64_t VFTableIndex)
> > + : VBTableIndex(VBTableIndex), VFTableIndex(VFTableIndex),
> > Shadowed(false) {}
> >
> > - MethodInfo()
> > - : VBTableIndex(0), VBase(0), VFTableIndex(0), Shadowed(false) {}
> > + MethodInfo() : VBTableIndex(0), VFTableIndex(0), Shadowed(false) {}
> > };
> >
> > typedef llvm::DenseMap<const CXXMethodDecl *, MethodInfo>
> MethodInfoMapTy;
> > @@ -2579,7 +2573,7 @@ private:
> > // and the entries shadowed by return adjusting thunks.
> > if (MD->getParent() != MostDerivedClass || MI.Shadowed)
> > continue;
> > - MethodVFTableLocation Loc(MI.VBTableIndex, MI.VBase,
> > + MethodVFTableLocation Loc(MI.VBTableIndex, WhichVFPtr.LastVBase,
> > WhichVFPtr.VFPtrOffset,
> MI.VFTableIndex);
> > if (const CXXDestructorDecl *DD =
> dyn_cast<CXXDestructorDecl>(MD)) {
> > MethodVFTableLocations[GlobalDecl(DD, Dtor_Deleting)] = Loc;
> > @@ -2873,7 +2867,6 @@ void VFTableBuilder::AddMethods(BaseSubo
> > // No return adjustment needed - just replace the overridden
> method info
> > // with the current info.
> > MethodInfo MI(OverriddenMethodInfo.VBTableIndex,
> > - OverriddenMethodInfo.VBase,
> > OverriddenMethodInfo.VFTableIndex);
> > MethodInfoMap.erase(OverriddenMDIterator);
> >
> > @@ -2919,7 +2912,7 @@ void VFTableBuilder::AddMethods(BaseSubo
> > // it requires return adjustment. Insert the method info for this
> method.
> > unsigned VBIndex =
> > LastVBase ? GetVBTableIndex(MostDerivedClass, LastVBase) : 0;
> > - MethodInfo MI(VBIndex, LastVBase, Components.size());
> > + MethodInfo MI(VBIndex, Components.size());
> >
> > assert(!MethodInfoMap.count(MD) &&
> > "Should not have method info for this method yet!");
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131022/e3d4c0fb/attachment.html>
More information about the cfe-commits
mailing list