]> granicus.if.org Git - clang/commitdiff
Remove an unnecessary parameter from EmitClassCopyAssignment.
authorAnders Carlsson <andersca@mac.com>
Fri, 30 Apr 2010 19:45:28 +0000 (19:45 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 30 Apr 2010 19:45:28 +0000 (19:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102747 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenFunction.h

index 6345ca34bac357a8eb8f025446a4f5daa99b8916..56d0e695c58bf8b98e298acc2d24ab9b4b8892ea 100644 (file)
@@ -624,19 +624,14 @@ void CodeGenFunction::EmitClassMemberwiseCopy(
 // FIXME. Consolidate this with EmitClassMemberwiseCopy as they share a lot.
 void 
 CodeGenFunction::EmitClassCopyAssignment(llvm::Value *Dest, llvm::Value *Src,
-                                         const CXXRecordDecl *ClassDecl,
-                                         const CXXRecordDecl *BaseClassDecl) {
-  if (ClassDecl) {
-    Dest = OldGetAddressOfBaseClass(Dest, ClassDecl, BaseClassDecl);
-    Src = OldGetAddressOfBaseClass(Src, ClassDecl, BaseClassDecl);
-  }
-  if (BaseClassDecl->hasTrivialCopyAssignment()) {
-    EmitAggregateCopy(Dest, Src, getContext().getTagDeclType(BaseClassDecl));
+                                         const CXXRecordDecl *ClassDecl) {
+  if (ClassDecl->hasTrivialCopyAssignment()) {
+    EmitAggregateCopy(Dest, Src, getContext().getTagDeclType(ClassDecl));
     return;
   }
 
   const CXXMethodDecl *MD = 0;
-  BaseClassDecl->hasConstCopyAssignment(getContext(), MD);
+  ClassDecl->hasConstCopyAssignment(getContext(), MD);
   assert(MD && "EmitClassCopyAssignment - missing copy assign");
 
   const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>();
@@ -799,7 +794,7 @@ void CodeGenFunction::SynthesizeCXXCopyAssignment(const FunctionArgList &Args) {
                                              /*NullCheckValue=*/false);
     CXXRecordDecl *BaseClassDecl
       = cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
-    EmitClassCopyAssignment(Dest, Src, 0, BaseClassDecl);
+    EmitClassCopyAssignment(Dest, Src, BaseClassDecl);
   }
 
   for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(),
@@ -828,7 +823,7 @@ void CodeGenFunction::SynthesizeCXXCopyAssignment(const FunctionArgList &Args) {
       }
       else
         EmitClassCopyAssignment(LHS.getAddress(), RHS.getAddress(),
-                               0 /*ClassDecl*/, FieldClassDecl);
+                                FieldClassDecl);
       continue;
     }
     // Do a built-in assignment of scalar data members.
index 3a8f60c4bd7fb0f0449157aa339facf5a06283ea..f164cf5b84ecb8fabc7804267065a6a5c52428bd 100644 (file)
@@ -822,8 +822,7 @@ public:
                                QualType Ty);
 
   void EmitClassCopyAssignment(llvm::Value *DestValue, llvm::Value *SrcValue,
-                               const CXXRecordDecl *ClassDecl,
-                               const CXXRecordDecl *BaseClassDecl);
+                               const CXXRecordDecl *ClassDecl);
 
   void EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor,
                                       CXXCtorType CtorType,