[cfe-commits] r96125 - /cfe/trunk/lib/CodeGen/CGVtable.cpp

Anders Carlsson andersca at mac.com
Sat Feb 13 14:23:32 PST 2010


Author: andersca
Date: Sat Feb 13 16:23:31 2010
New Revision: 96125

URL: http://llvm.org/viewvc/llvm-project?rev=96125&view=rev
Log:
Assert if we encounter this adjustments.

Modified:
    cfe/trunk/lib/CodeGen/CGVtable.cpp

Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=96125&r1=96124&r2=96125&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Sat Feb 13 16:23:31 2010
@@ -219,6 +219,7 @@
   /// and we want to override B::f with C::f, we also need to override A::f with
   /// C::f.
   void PropagateOverrider(const CXXMethodDecl *OldMD,
+                          BaseSubobject NewBase,
                           const CXXMethodDecl *NewMD,
                           SubobjectOffsetsMapTy &Offsets);
   
@@ -290,7 +291,7 @@
       continue;
 
     // First, propagate the overrider.
-    PropagateOverrider(MD, MD, Offsets);
+    PropagateOverrider(MD, Base, MD, Offsets);
 
     // Add the overrider as the final overrider of itself.
     OverriderInfo& Overrider = OverridersMap[std::make_pair(Base, MD)];
@@ -409,6 +410,7 @@
 }
 
 void FinalOverriders::PropagateOverrider(const CXXMethodDecl *OldMD,
+                                         BaseSubobject NewBase,
                                          const CXXMethodDecl *NewMD,
                                          SubobjectOffsetsMapTy &Offsets) {
   for (CXXMethodDecl::method_iterator I = OldMD->begin_overridden_methods(),
@@ -446,13 +448,18 @@
           // Store the return adjustment base offset.
           ReturnAdjustments[SubobjectAndMethod] = ReturnBaseOffset;
         }
+        
+        // Check if we need a 'this' adjustment base offset as well.
+        if (Offset != NewBase.getBaseOffset()) {
+          assert(false && "FIXME: Handle 'this' adjustments!");
+        }
       }
 
       // Set the new overrider.
       Overrider.Method = NewMD;
       
       // And propagate it further.
-      PropagateOverrider(OverriddenMD, NewMD, Offsets);
+      PropagateOverrider(OverriddenMD, NewBase, NewMD, Offsets);
     }
   }
 }





More information about the cfe-commits mailing list