]> granicus.if.org Git - clang/commitdiff
Store the base offset of the final overrider in the OverriderInfo struct, to be used...
authorAnders Carlsson <andersca@mac.com>
Thu, 18 Feb 2010 16:29:24 +0000 (16:29 +0000)
committerAnders Carlsson <andersca@mac.com>
Thu, 18 Feb 2010 16:29:24 +0000 (16:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96582 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index b4c10a55c6649dc916a43d687350f2d3872c8acc..1f4d64d0fbbb206e3907f42a133f93319639fbf3 100644 (file)
@@ -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.