Adds support for generation of objc_memmove_collectable API
in Objective-C++ mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104281 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index eccb6e6..f93c79c 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "CodeGenFunction.h"
+#include "CGObjCRuntime.h"
using namespace clang;
using namespace CodeGen;
@@ -274,7 +275,10 @@
llvm::Value *Src = EmitLValue(E->getArg(1)).getAddress();
QualType Ty = E->getType();
- EmitAggregateCopy(This, Src, Ty);
+ if (ClassDecl->hasObjectMember())
+ CGM.getObjCRuntime().EmitGCMemmoveCollectable(*this, This, Src, Ty);
+ else
+ EmitAggregateCopy(This, Src, Ty);
return RValue::get(This);
}
}