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

Anders Carlsson andersca at mac.com
Wed Feb 24 14:32:18 PST 2010


Author: andersca
Date: Wed Feb 24 16:32:18 2010
New Revision: 97068

URL: http://llvm.org/viewvc/llvm-project?rev=97068&view=rev
Log:
Get rid of 'this' adjustments from the FinalOverriders class since they can be different for the same overrider in different parts of the vtable.

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=97068&r1=97067&r2=97068&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Wed Feb 24 16:32:18 2010
@@ -97,10 +97,6 @@
   /// ReturnAdjustments - Holds return adjustments for all the overriders that 
   /// need to perform return value adjustments.
   AdjustmentOffsetsMapTy ReturnAdjustments;
-  
-  /// ThisAdjustments - Holds 'this' adjustments for all the overriders that
-  /// need them.
-  AdjustmentOffsetsMapTy ThisAdjustments;
 
   typedef llvm::SmallVector<uint64_t, 1> OffsetVectorTy;
   
@@ -174,14 +170,6 @@
     return ReturnAdjustments.lookup(std::make_pair(Base, MD));
   }
 
-  /// getThisAdjustmentOffset - Get the 'this' pointer adjustment offset for the
-  /// method decl in the given base subobject. Returns an empty base offset if
-  /// no adjustment is needed.
-  BaseOffset getThisAdjustmentOffset(BaseSubobject Base,
-                                     const CXXMethodDecl *MD) const {
-    return ThisAdjustments.lookup(std::make_pair(Base, MD));
-  }
-  
   /// dump - dump the final overriders.
   void dump() {
     assert(VisitedVirtualBases.empty() &&
@@ -450,17 +438,6 @@
           // Store the return adjustment base offset.
           ReturnAdjustments[SubobjectAndMethod] = ReturnBaseOffset;
         }
-        
-        // Check if we need a 'this' adjustment base offset as well.
-        if (Offset != NewBase.getBaseOffset()) {
-          BaseOffset ThisBaseOffset =
-            ComputeThisAdjustmentBaseOffset(OverriddenSubobject,
-                                            NewBase);
-          assert(!ThisBaseOffset.isEmpty() && 
-                 "Should not get an empty 'this' adjustment!");
-          
-          ThisAdjustments[SubobjectAndMethod] = ThisBaseOffset;
-        }
       }
 
       // Set the new overrider.
@@ -639,17 +616,6 @@
       Out << Offset.NonVirtualOffset << " nv]";
     }
     
-    AI = ThisAdjustments.find(std::make_pair(Base, MD));
-    if (AI != ThisAdjustments.end()) {
-      const BaseOffset &Offset = AI->second;
-      
-      Out << " [this-adj: ";
-      if (Offset.VirtualBase)
-        Out << Offset.VirtualBase->getQualifiedNameAsString() << " vbase, ";
-      
-      Out << Offset.NonVirtualOffset << " nv]";
-    }
-    
     Out << "\n";
   }  
 }





More information about the cfe-commits mailing list