]> granicus.if.org Git - clang/commitdiff
Revert r90402 for now, virt.cpp is failing.
authorAnders Carlsson <andersca@mac.com>
Thu, 3 Dec 2009 03:28:24 +0000 (03:28 +0000)
committerAnders Carlsson <andersca@mac.com>
Thu, 3 Dec 2009 03:28:24 +0000 (03:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90406 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index caac82701664c1597b96035126d50780f2f44206..007960e9983f36f8f27689ea38f7e225e59889a1 100644 (file)
@@ -274,20 +274,18 @@ public:
         
         Thunks.erase(i);
       }
-
-      QualType BaseType = QualType(Thunk.ReturnType)->getPointeeType();
+      
+      // Construct the return adjustment.
       QualType DerivedType = 
-        MD->getType()->getAs<FunctionType>()->getResultType()->getPointeeType();
+        MD->getType()->getAs<FunctionType>()->getResultType();
       
-      const CXXRecordDecl *BaseDecl = 
-        cast<CXXRecordDecl>(BaseType->getAs<RecordType>()->getDecl());
+      int64_t NonVirtualAdjustment = 
+        getNVOffset(Thunk.ReturnType, DerivedType) / 8;
       
-      const CXXRecordDecl *DerivedDecl = 
-        cast<CXXRecordDecl>(DerivedType->getAs<RecordType>()->getDecl());
+      int64_t VirtualAdjustment = 
+        getVbaseOffset(Thunk.ReturnType, DerivedType);
       
-      // Construct the return adjustment.
-      ThunkAdjustment ReturnAdjustment = 
-        CGM.ComputeThunkAdjustment(DerivedDecl, BaseDecl);
+      ThunkAdjustment ReturnAdjustment(NonVirtualAdjustment, VirtualAdjustment);
       
       CovariantThunkAdjustment Adjustment(ThisAdjustment, ReturnAdjustment);
       submethods[Index] = CGM.BuildCovariantThunk(MD, Extern, Adjustment);
@@ -747,7 +745,7 @@ TypeConversionRequiresAdjustment(ASTContext &Ctx,
   }
   
   const CXXRecordDecl *DerivedDecl = 
-    cast<CXXRecordDecl>(cast<RecordType>(CanDerivedType)->getDecl());
+  cast<CXXRecordDecl>(cast<RecordType>(CanDerivedType)->getDecl());
   
   const CXXRecordDecl *BaseDecl = 
   cast<CXXRecordDecl>(cast<RecordType>(CanBaseType)->getDecl());