aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGClass.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-04-30 00:04:01 +0000
committerAnders Carlsson <andersca@mac.com>2010-04-30 00:04:01 +0000
commitf406d9c68762163cf817230bca13030e4d10514e (patch)
tree0e973cb905a0950a42df2e6c1ca8fac4ea5a342f /lib/CodeGen/CGClass.cpp
parent9ffdd45c56e2f143016f6c78fe2d7ca652c1b57a (diff)
Get the base class addresses before calling EmitClassCopyAssignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGClass.cpp')
-rw-r--r--lib/CodeGen/CGClass.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
index 1641a83a60..98ed1b3b2f 100644
--- a/lib/CodeGen/CGClass.cpp
+++ b/lib/CodeGen/CGClass.cpp
@@ -778,13 +778,16 @@ void CodeGenFunction::SynthesizeCXXCopyAssignment(const FunctionArgList &Args) {
for (CXXRecordDecl::base_class_const_iterator Base = ClassDecl->bases_begin();
Base != ClassDecl->bases_end(); ++Base) {
- // FIXME. copy assignment of virtual base NYI
- if (Base->isVirtual())
- continue;
-
+
+ llvm::Value *Dest = GetAddressOfBaseClass(ThisPtr, ClassDecl,
+ CXXBaseSpecifierArray(Base),
+ /*NullCheckValue=*/false);
+ llvm::Value *Src = GetAddressOfBaseClass(SrcPtr, ClassDecl,
+ CXXBaseSpecifierArray(Base),
+ /*NullCheckValue=*/false);
CXXRecordDecl *BaseClassDecl
= cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
- EmitClassCopyAssignment(ThisPtr, SrcPtr, ClassDecl, BaseClassDecl);
+ EmitClassCopyAssignment(Dest, Src, 0, BaseClassDecl);
}
for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(),