Store the base offset of the final overrider in the OverriderInfo struct, to be used for vcall offsets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96582 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anders Carlsson 2010-02-18 16:29:24 +00:00
Родитель 588f91ae2c
Коммит 96309c4a3d
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -58,8 +58,11 @@ public:
struct OverriderInfo {
/// Method - The method decl of the overrider.
const CXXMethodDecl *Method;
/// BaseOffset - the base offset of the overrider.
uint64_t BaseOffset;
OverriderInfo() : Method(0) { }
OverriderInfo() : Method(0), BaseOffset(0) { }
};
private:
@ -236,6 +239,7 @@ void FinalOverriders::AddOverriders(BaseSubobject Base,
OverriderInfo& Overrider = OverridersMap[std::make_pair(Base, MD)];
assert(!Overrider.Method && "Overrider should not exist yet!");
Overrider.BaseOffset = Base.getBaseOffset();
Overrider.Method = MD;
}
}
@ -460,6 +464,7 @@ void FinalOverriders::PropagateOverrider(const CXXMethodDecl *OldMD,
}
// Set the new overrider.
Overrider.BaseOffset = NewBase.getBaseOffset();
Overrider.Method = NewMD;
// And propagate it further.