[cfe-commits] r102674 - in /cfe/trunk/lib/CodeGen: CGClass.cpp CodeGenFunction.h

Anders Carlsson andersca at mac.com
Thu Apr 29 16:51:42 PDT 2010


Author: andersca
Date: Thu Apr 29 18:51:42 2010
New Revision: 102674

URL: http://llvm.org/viewvc/llvm-project?rev=102674&view=rev
Log:
Remove an unnecessary argument to EmitClassCopyAssignment.

Modified:
    cfe/trunk/lib/CodeGen/CGClass.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=102674&r1=102673&r2=102674&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Thu Apr 29 18:51:42 2010
@@ -622,17 +622,16 @@
 /// object from SrcValue to DestValue. Assignment can be either a bitwise
 /// assignment of via an assignment operator call.
 // 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,
-                                        QualType Ty) {
+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, Ty);
+    EmitAggregateCopy(Dest, Src, getContext().getTagDeclType(BaseClassDecl));
     return;
   }
 
@@ -785,8 +784,7 @@
 
     CXXRecordDecl *BaseClassDecl
       = cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
-    EmitClassCopyAssignment(ThisPtr, SrcPtr, ClassDecl, BaseClassDecl,
-                            Base->getType());
+    EmitClassCopyAssignment(ThisPtr, SrcPtr, ClassDecl, BaseClassDecl);
   }
 
   for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(),
@@ -815,7 +813,7 @@
       }
       else
         EmitClassCopyAssignment(LHS.getAddress(), RHS.getAddress(),
-                               0 /*ClassDecl*/, FieldClassDecl, FieldType);
+                               0 /*ClassDecl*/, FieldClassDecl);
       continue;
     }
     // Do a built-in assignment of scalar data members.

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=102674&r1=102673&r2=102674&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Thu Apr 29 18:51:42 2010
@@ -823,8 +823,7 @@
 
   void EmitClassCopyAssignment(llvm::Value *DestValue, llvm::Value *SrcValue,
                                const CXXRecordDecl *ClassDecl,
-                               const CXXRecordDecl *BaseClassDecl,
-                               QualType Ty);
+                               const CXXRecordDecl *BaseClassDecl);
 
   void EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor,
                                       CXXCtorType CtorType,





More information about the cfe-commits mailing list