From: Anders Carlsson Date: Thu, 18 Feb 2010 16:29:24 +0000 (+0000) Subject: Store the base offset of the final overrider in the OverriderInfo struct, to be used... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96309c4a3d57184b7adba5cd85edb9bf1777f3b1;p=clang 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 --- diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index b4c10a55c6..1f4d64d0fb 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -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.