Skip to content

Commit

Permalink
Drop the unneeded VBase field from MethodInfo in the VFTableBuilder c…
Browse files Browse the repository at this point in the history
…lass

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193164 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
timurrrr committed Oct 22, 2013
1 parent 87017a7 commit e39c0f3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions lib/AST/VTableBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2483,10 +2483,6 @@ class VFTableBuilder {
/// 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;

Expand All @@ -2495,13 +2491,11 @@ class VFTableBuilder {
/// 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;
Expand Down Expand Up @@ -2579,7 +2573,7 @@ class VFTableBuilder {
// 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;
Expand Down Expand Up @@ -2873,7 +2867,6 @@ void VFTableBuilder::AddMethods(BaseSubobject Base, unsigned BaseDepth,
// 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);

Expand Down Expand Up @@ -2919,7 +2912,7 @@ void VFTableBuilder::AddMethods(BaseSubobject Base, unsigned BaseDepth,
// 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!");
Expand Down

0 comments on commit e39c0f3

Please sign in to comment.